Skip to content

Conversation

@crazytonyli
Copy link
Contributor

Description

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

@crazytonyli crazytonyli added this to the 26.6 milestone Dec 1, 2025
@crazytonyli crazytonyli requested review from jkmassel and kean December 1, 2025 02:24
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Dec 1, 2025

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number30099
VersionPR #25040
Bundle IDorg.wordpress.alpha
Commit83c8cc0
Installation URL60slvav9m6be8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Dec 1, 2025

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number30099
VersionPR #25040
Bundle IDcom.jetpack.alpha
Commit83c8cc0
Installation URL60uounfbr3u50
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

}

@objc
func hasPhoto() -> Bool {
Copy link
Contributor

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 {
Copy link
Contributor

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
Copy link
Contributor

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.

@crazytonyli
Copy link
Contributor Author

@kean I have addressed your feedbacks in the commits above.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 8, 2025

@kean kean self-requested a review December 9, 2025 00:04
kean
kean approved these changes Dec 9, 2025
if url.isFileURL {
requestURL = url
} else if post.isPrivateAtWPCom() && url.isHostedAtWPCom {
} else if post.blog.isPrivateAtWPCom() && url.isHostedAtWPCom {
Copy link
Contributor

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.

@crazytonyli crazytonyli added this pull request to the merge queue Dec 9, 2025
Merged via the queue into trunk with commit 6a66f68 Dec 9, 2025
26 of 32 checks passed
@crazytonyli crazytonyli deleted the core-data-models-posts-helpers branch December 9, 2025 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants