-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Translate AbstractPost to Swift #25040
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 30099 | |
| Version | PR #25040 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 83c8cc0 | |
| Installation URL | 60slvav9m6be8 |
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 30099 | |
| Version | PR #25040 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 83c8cc0 | |
| Installation URL | 60uounfbr3u50 |
| } | ||
|
|
||
| @objc | ||
| func hasPhoto() -> Bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move these method in PostEditor+Publish.swift as a private Swift-only extension.
| } | ||
|
|
||
| @objc | ||
| func shouldPublishImmediately() -> Bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldPublishImmediately and some of the other methods are not used from Objective-C.
| /// Returns YES if the post is a published. | ||
| @objc | ||
| func isPublished() -> Bool { | ||
| status == .publish |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is used in a single place. Let's remove it and review other similar methods that are one-liners and don't create much value.
|
@kean I have addressed your feedbacks in the commits above. |
|
| if url.isFileURL { | ||
| requestURL = url | ||
| } else if post.isPrivateAtWPCom() && url.isHostedAtWPCom { | ||
| } else if post.blog.isPrivateAtWPCom() && url.isHostedAtWPCom { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I like the removal of these excessive convenience methods that proxy to blog.





Description
This PR translates the majority of the AbstractPost functions to Swift. It should be pretty straightforward to review commit by commit.