Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit 50916f6

Browse files
committed
Convert -(NSString *)WordPressComJSONString method to Swift
1 parent 360a0a2 commit 50916f6

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

WordPressKit.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
3F8308A729EE683500354497 /* ActivityTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F8308A629EE683500354497 /* ActivityTests.swift */; };
7373
3FB8642C2888089F003A86BE /* BuildkiteTestCollector in Frameworks */ = {isa = PBXBuildFile; productRef = 3FB8642B2888089F003A86BE /* BuildkiteTestCollector */; };
7474
3FFCC0412BA995290051D229 /* NSDate+RFC3339Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FFCC0402BA995290051D229 /* NSDate+RFC3339Tests.swift */; };
75+
3FFCC0472BAA6EF40051D229 /* NSDate+RFC3339.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FFCC0462BAA6EF40051D229 /* NSDate+RFC3339.swift */; };
7576
40247DFA2120D8E100AE1C3C /* AutomatedTransferService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40247DF92120D8E100AE1C3C /* AutomatedTransferService.swift */; };
7677
40247DFC2120E69600AE1C3C /* AutomatedTransferStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40247DFB2120E69600AE1C3C /* AutomatedTransferStatus.swift */; };
7778
404057C5221B30400060250C /* StatsSearchTermTimeIntervalData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 404057C4221B30400060250C /* StatsSearchTermTimeIntervalData.swift */; };
@@ -800,6 +801,7 @@
800801
3F8308A629EE683500354497 /* ActivityTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityTests.swift; sourceTree = "<group>"; };
801802
3FB8642D288813E9003A86BE /* UnitTests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = UnitTests.xctestplan; sourceTree = "<group>"; };
802803
3FFCC0402BA995290051D229 /* NSDate+RFC3339Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSDate+RFC3339Tests.swift"; sourceTree = "<group>"; };
804+
3FFCC0462BAA6EF40051D229 /* NSDate+RFC3339.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSDate+RFC3339.swift"; sourceTree = "<group>"; };
803805
40247DF92120D8E100AE1C3C /* AutomatedTransferService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutomatedTransferService.swift; sourceTree = "<group>"; };
804806
40247DFB2120E69600AE1C3C /* AutomatedTransferStatus.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutomatedTransferStatus.swift; sourceTree = "<group>"; };
805807
404057C4221B30400060250C /* StatsSearchTermTimeIntervalData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatsSearchTermTimeIntervalData.swift; sourceTree = "<group>"; };
@@ -2523,6 +2525,7 @@
25232525
93BD27741EE73944002BB00B /* HTTPAuthenticationAlertController.swift */,
25242526
93BD27751EE73944002BB00B /* NSDate+WordPressJSON.h */,
25252527
93BD27761EE73944002BB00B /* NSDate+WordPressJSON.m */,
2528+
3FFCC0462BAA6EF40051D229 /* NSDate+RFC3339.swift */,
25262529
93BD27771EE73944002BB00B /* WordPressComOAuthClient.swift */,
25272530
93BD27781EE73944002BB00B /* WordPressComRestApi.swift */,
25282531
93BD27791EE73944002BB00B /* WordPressOrgXMLRPCApi.swift */,
@@ -3462,6 +3465,7 @@
34623465
E632D7781F6E047400297F6D /* SocialLogin2FANonceInfo.swift in Sources */,
34633466
32FC1D29255C91ED00CD0A7B /* JetpackScanServiceRemote.swift in Sources */,
34643467
9F3E0B9B208732B3009CB5BA /* RemoteReaderSiteInfoSubscription.swift in Sources */,
3468+
3FFCC0472BAA6EF40051D229 /* NSDate+RFC3339.swift in Sources */,
34653469
7403A2E41EF06ED500DED7DC /* AccountSettingsRemote.swift in Sources */,
34663470
3236F77824AE34B40088E8F3 /* ReaderTopicServiceRemote+Interests.swift in Sources */,
34673471
FE20A6A4282A96C00025E975 /* RemoteBloggingPromptsSettings.swift in Sources */,

WordPressKit/NSDate+RFC3339.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Foundation
2+
3+
extension NSDate {
4+
5+
@objc(WordPressComJSONString)
6+
public func wordPressComJSONString() -> String {
7+
NSDate.rfc3339DateFormatter().string(from: self as Date)
8+
}
9+
}

WordPressKit/NSDate+WordPressJSON.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,4 @@
1616

1717
+ (instancetype)dateWithWordPressComJSONString:(NSString *)string;
1818

19-
- (NSString *)WordPressComJSONString;
20-
2119
@end

WordPressKit/NSDate+WordPressJSON.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,4 @@ + (instancetype)dateWithWordPressComJSONString:(NSString *)string {
1919
return [[self rfc3339DateFormatter] dateFromString:string];
2020
}
2121

22-
- (NSString *)WordPressComJSONString {
23-
return [[[self class] rfc3339DateFormatter] stringFromDate:self];
24-
}
25-
2622
@end

0 commit comments

Comments
 (0)