Skip to content

Conversation

@crazytonyli
Copy link
Contributor

Description

No feature changes, just moving to Swift. It'd be easier to review commit by commit to compare the original Objective-C code and the new Swift code.

Note

I'll merge this PR after #24999.

Testing instructions

@crazytonyli crazytonyli added this to the 26.5 milestone Nov 20, 2025
@crazytonyli crazytonyli requested review from jkmassel and kean November 20, 2025 00:42
@dangermattic
Copy link
Collaborator

dangermattic commented Nov 20, 2025

1 Warning
⚠️ This PR is assigned to the milestone 26.5. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Nov 20, 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 Number29850
VersionPR #25003
Bundle IDorg.wordpress.alpha
Commit0c20429
Installation URL66hgu4dfl0rgg
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 Nov 20, 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 Number29850
VersionPR #25003
Bundle IDcom.jetpack.alpha
Commit0c20429
Installation URL2pn8kl8bef90o
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Base automatically changed from core-data-model-posts to trunk November 20, 2025 06:51
@crazytonyli crazytonyli force-pushed the core-data-model-posts-functions branch from 128254a to 0c20429 Compare November 20, 2025 10:23
@crazytonyli crazytonyli marked this pull request as ready for review November 20, 2025 10:24
@sonarqubecloud
Copy link

} else if self.shouldPublishImmediately() {
return NSLocalizedString("Publish Immediately", comment: "A short phrase indicating a post is due to be immedately published.")
}
return self.dateCreated?.toMediumString()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's super rough that dateCreated can be nil – do we know of any scenario where it should be?


var authorDisplayName: String {
settings.author?.displayName ?? post.authorNameForDisplay()
settings.author?.displayName ?? post.author?.makePlainText() ?? ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue here – any reason the author should be nullable?

return cell
}

if post.isCross() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What a weird auto-ObjC translation – I had to check that isCross() and isCrossPost were the same in Xcode 🙃

public func avatarURLForDisplay() -> URL? {
authorAvatarURL.flatMap(URL.init(string:))
}
public func sourceAttributionStyle() -> SourceAttributionStyle {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this takes no params, I wonder if it should be a var but that's a nit

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same note for the other func translations

Copy link
Contributor

@jkmassel jkmassel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was super easy to review commit-by-commit, thanks!

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.

5 participants