This repository was archived by the owner on Sep 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Re-implement a few model types in Swift #560
Merged
crazytonyli
merged 4 commits into
translate-objc-to-swift
from
swift-translation-random-ones
Dec 16, 2022
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
af0af1d
Re-implement a few model types in Swift
crazytonyli 4bee659
Re-implement RemoteMedia and RemoteComment
crazytonyli d2d1125
Declare as `[String]` instead of `NSArray`
crazytonyli 9944478
Merge branch 'translate-objc-to-swift' into swift-translation-random-…
crazytonyli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| #import "MediaServiceRemoteXMLRPC.h" | ||
| #import "RemoteMedia.h" | ||
| #import "WPKit-Swift.h" | ||
|
|
||
| @import WordPressShared; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import Foundation | ||
|
|
||
| @objcMembers public class RemoteComment: NSObject { | ||
|
|
||
| public var commentID: NSNumber? | ||
| public var authorID: NSNumber? | ||
| public var author: String? | ||
| public var authorEmail: String? | ||
| public var authorUrl: String? | ||
| public var authorAvatarURL: String? | ||
| public var authorIP: String? | ||
| public var content: String? | ||
| public var rawContent: String? | ||
| public var date: Date? | ||
| public var link: String? | ||
| public var parentID: NSNumber? | ||
| public var postID: NSNumber? | ||
| public var postTitle: String? | ||
| public var status: String? | ||
| public var type: String? | ||
| public var isLiked: Bool = false | ||
| public var likeCount: NSNumber? | ||
| public var canModerate: Bool = false | ||
|
|
||
| } | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| import Foundation | ||
|
|
||
| @objcMembers public class RemoteMedia: NSObject { | ||
|
|
||
| public var mediaID: NSNumber? | ||
| public var url: URL? | ||
| public var localURL: URL? | ||
| public var largeURL: URL? | ||
| public var mediumURL: URL? | ||
| public var guid: URL? | ||
| public var date: Date? | ||
| public var postID: NSNumber? | ||
| public var file: String? | ||
| public var mimeType: String? | ||
| public var `extension`: String? | ||
| public var title: String? | ||
| public var caption: String? | ||
| public var descriptionText: String? | ||
| public var alt: String? | ||
| public var height: NSNumber? | ||
| public var width: NSNumber? | ||
| public var shortcode: String? | ||
| public var exif: NSDictionary? | ||
| public var videopressGUID: String? | ||
| public var length: NSNumber? | ||
| public var remoteThumbnailURL: String? | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import Foundation | ||
|
|
||
| @objcMembers public class RemoteSourcePostAttribution: NSObject { | ||
|
|
||
| public var permalink: String? | ||
| public var authorName: String? | ||
| public var authorURL: String? | ||
| public var blogName: String? | ||
| public var blogURL: String? | ||
| public var avatarURL: String? | ||
| public var blogID: NSNumber? | ||
| public var postID: NSNumber? | ||
| public var likeCount: NSNumber? | ||
| public var commentCount: NSNumber? | ||
| public var taxonomies: [String]? | ||
|
|
||
| } |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import Foundation | ||
|
|
||
| @objcMembers public class RemoteTheme: NSObject { | ||
|
|
||
| public var active: Bool = false | ||
| public var author: String? | ||
| public var authorUrl: String? | ||
| public var desc: String? | ||
| public var demoUrl: String? | ||
| public var themeUrl: String? | ||
| public var downloadUrl: String? | ||
| public var launchDate: Date? | ||
| public var name: String? | ||
| public var order: NSInteger = 0 | ||
| public var popularityRank: NSNumber? | ||
| public var previewUrl: String? | ||
| public var price: String? | ||
| public var purchased: NSNumber? | ||
| public var screenshotUrl: String? | ||
| public var stylesheet: String? | ||
| public var themeId: String? | ||
| public var trendingRank: NSNumber? | ||
| public var version: String? | ||
|
|
||
| } |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import Foundation | ||
|
|
||
| @objcMembers public class RemoteUser: NSObject { | ||
|
|
||
| public var userID: NSNumber? | ||
| public var username: String? | ||
| public var email: String? | ||
| public var displayName: String? | ||
| public var primaryBlogID: NSNumber? | ||
| public var avatarURL: String? | ||
| public var dateCreated: Date? | ||
| public var emailVerified: Bool = false | ||
| public var linkedUserID: NSNumber? | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
TIL
@objcMembers!