diff --git a/Modules/Package.resolved b/Modules/Package.resolved index 60449d5b3748..9233e7511457 100644 --- a/Modules/Package.resolved +++ b/Modules/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "fc506146d3417f510d63ab76b049adbce29d86cec825ee4208cc9554bb743faa", + "originHash" : "9a980b8a6fb8e8447784dc15711ebea95c0ed816e2b97797a31cc3035da386bc", "pins" : [ { "identity" : "alamofire", @@ -381,7 +381,17 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/wordpress-mobile/WordPressKit-iOS", "state" : { - "revision" : "440d94e3a3d6f9f39035a371984e088a2fb42a32" + "branch" : "rework-spm", + "revision" : "6a8e615741fc86b028a85f58a9d638e57a6affcb" + } + }, + { + "identity" : "wpxmlrpc", + "kind" : "remoteSourceControl", + "location" : "https://github.com/wordpress-mobile/wpxmlrpc", + "state" : { + "revision" : "bfc413d336bdeaab89e62dc483380baa99b2257e", + "version" : "0.10.0" } }, { diff --git a/Modules/Package.swift b/Modules/Package.swift index 07bd38013c55..448feeabe53d 100644 --- a/Modules/Package.swift +++ b/Modules/Package.swift @@ -50,7 +50,7 @@ let package = Package( .package(url: "https://github.com/wordpress-mobile/NSURL-IDN", revision: "b34794c9a3f32312e1593d4a3d120572afa0d010"), .package( url: "https://github.com/wordpress-mobile/WordPressKit-iOS", - revision: "440d94e3a3d6f9f39035a371984e088a2fb42a32" + branch: "rework-spm" ), .package(url: "https://github.com/zendesk/support_sdk_ios", from: "8.0.3"), // We can't use wordpress-rs branches nor commits here. Only tags work. @@ -273,6 +273,7 @@ enum XcodeSupport { .product(name: "ZIPFoundation", package: "ZIPFoundation"), .product(name: "Aztec", package: "AztecEditor-iOS"), .product(name: "WordPressEditor", package: "AztecEditor-iOS"), + .product(name: "WordPressKit", package: "WordPressKit-iOS"), ] let testDependencies: [Target.Dependency] = [ @@ -392,6 +393,7 @@ enum XcodeSupport { .product(name: "CocoaLumberjack", package: "CocoaLumberjack"), .product(name: "CocoaLumberjackSwift", package: "CocoaLumberjack"), .product(name: "WordPressAPI", package: "wordpress-rs"), + .product(name: "WordPressKit", package: "WordPressKit-iOS"), ]), .xcodeTarget("XcodeTarget_Intents", dependencies: [ "BuildSettingsKit", diff --git a/Modules/Sources/JetpackStats/Services/StatsService.swift b/Modules/Sources/JetpackStats/Services/StatsService.swift index 44d61446cf03..9351fade06f0 100644 --- a/Modules/Sources/JetpackStats/Services/StatsService.swift +++ b/Modules/Sources/JetpackStats/Services/StatsService.swift @@ -266,8 +266,10 @@ actor StatsService: StatsServiceProtocol { excludeUserIDs: nil, success: { users, found in let likeUsers = users.map { remoteLike in - PostLikesData.PostLikeUser( - id: remoteLike.userID.intValue, + wpAssert(remoteLike.userID != nil, "user id must not be nil") + + return PostLikesData.PostLikeUser( + id: remoteLike.userID?.intValue ?? 0, name: remoteLike.displayName ?? remoteLike.username ?? "", avatarURL: remoteLike.avatarURL.flatMap(URL.init) ) diff --git a/Sources/WordPressAuthenticator/Helpers/LoginFacade.h b/Sources/WordPressAuthenticator/Helpers/LoginFacade.h index 13c37162ef03..01a7aa40206f 100644 --- a/Sources/WordPressAuthenticator/Helpers/LoginFacade.h +++ b/Sources/WordPressAuthenticator/Helpers/LoginFacade.h @@ -1,5 +1,9 @@ #import +// This is a strange hack to make the `-[LoginFacadeDelegate needsMultifactorCodeForUserID:andNonceInfo:]` +// available in Objective-C runtime. +@import WordPressKit; + NS_ASSUME_NONNULL_BEGIN @class LoginFields; diff --git a/Sources/WordPressData/Objective-C/Blog.m b/Sources/WordPressData/Objective-C/Blog.m index 1f51d830489d..7933b853b017 100644 --- a/Sources/WordPressData/Objective-C/Blog.m +++ b/Sources/WordPressData/Objective-C/Blog.m @@ -7,6 +7,7 @@ @import WordPressShared; @import NSObject_SafeExpectations; @import NSURL_IDN; +@import WordPressKit; @class Comment; diff --git a/Sources/WordPressData/Objective-C/PostHelper.m b/Sources/WordPressData/Objective-C/PostHelper.m index b2252f0216d9..82d3d7c4bf43 100644 --- a/Sources/WordPressData/Objective-C/PostHelper.m +++ b/Sources/WordPressData/Objective-C/PostHelper.m @@ -3,6 +3,7 @@ #import "WordPressData-Swift.h" @import WordPressKit; +@import WordPressKitModels; @import WordPressShared; @import NSObject_SafeExpectations; diff --git a/Sources/WordPressData/Objective-C/ReaderPost.m b/Sources/WordPressData/Objective-C/ReaderPost.m index e7e1ea5b6ad6..1a50a59d7e0a 100644 --- a/Sources/WordPressData/Objective-C/ReaderPost.m +++ b/Sources/WordPressData/Objective-C/ReaderPost.m @@ -4,6 +4,7 @@ #import "WordPressData-Swift.h" @import WordPressKit; +@import WordPressKitModels; @import WordPressShared; // These keys are used in the getStoredComment method diff --git a/Sources/WordPressData/Objective-C/include/Blog.h b/Sources/WordPressData/Objective-C/include/Blog.h index 890472980442..bd7462257158 100644 --- a/Sources/WordPressData/Objective-C/include/Blog.h +++ b/Sources/WordPressData/Objective-C/include/Blog.h @@ -2,6 +2,8 @@ #import #import +@import WordPressKit; + NS_ASSUME_NONNULL_BEGIN @class AbstractPost; diff --git a/Sources/WordPressData/Objective-C/include/PostServiceOptions.h b/Sources/WordPressData/Objective-C/include/PostServiceOptions.h index a42173b46d6d..d597b5a1b50c 100644 --- a/Sources/WordPressData/Objective-C/include/PostServiceOptions.h +++ b/Sources/WordPressData/Objective-C/include/PostServiceOptions.h @@ -1,4 +1,4 @@ -#import +@import WordPressKitObjC; /** @class PostServiceSyncOptions diff --git a/Sources/WordPressData/Objective-C/include/WPAccount.h b/Sources/WordPressData/Objective-C/include/WPAccount.h index 8ef8d59f7a8d..548de18f111f 100644 --- a/Sources/WordPressData/Objective-C/include/WPAccount.h +++ b/Sources/WordPressData/Objective-C/include/WPAccount.h @@ -1,6 +1,8 @@ #import #import +@import WordPressKit; + NS_ASSUME_NONNULL_BEGIN @class Blog; diff --git a/Sources/WordPressData/Swift/BloggingPrompt+CoreDataClass.swift b/Sources/WordPressData/Swift/BloggingPrompt+CoreDataClass.swift index 8dbb74d13bac..7b19340f67fc 100644 --- a/Sources/WordPressData/Swift/BloggingPrompt+CoreDataClass.swift +++ b/Sources/WordPressData/Swift/BloggingPrompt+CoreDataClass.swift @@ -1,6 +1,5 @@ import Foundation import CoreData -import WordPressKit public class BloggingPrompt: NSManagedObject { diff --git a/Sources/WordPressData/Swift/PageTemplateCategory+CoreDataProperties.swift b/Sources/WordPressData/Swift/PageTemplateCategory+CoreDataProperties.swift index cc3c4879297b..0f55ce8f8077 100644 --- a/Sources/WordPressData/Swift/PageTemplateCategory+CoreDataProperties.swift +++ b/Sources/WordPressData/Swift/PageTemplateCategory+CoreDataProperties.swift @@ -1,5 +1,6 @@ import Foundation import CoreData +import WordPressKit extension PageTemplateCategory { diff --git a/Sources/WordPressData/Swift/PageTemplateLayout+CoreDataProperties.swift b/Sources/WordPressData/Swift/PageTemplateLayout+CoreDataProperties.swift index a83ef82727f2..e5c31c3d816d 100644 --- a/Sources/WordPressData/Swift/PageTemplateLayout+CoreDataProperties.swift +++ b/Sources/WordPressData/Swift/PageTemplateLayout+CoreDataProperties.swift @@ -1,5 +1,6 @@ import Foundation import CoreData +import WordPressKit extension PageTemplateLayout { diff --git a/Sources/WordPressData/Swift/PostHelper+Metadata.swift b/Sources/WordPressData/Swift/PostHelper+Metadata.swift index 6285a7ffcf01..940a12682ed0 100644 --- a/Sources/WordPressData/Swift/PostHelper+Metadata.swift +++ b/Sources/WordPressData/Swift/PostHelper+Metadata.swift @@ -1,5 +1,6 @@ import Foundation import WordPressShared +import WordPressKit public extension PostHelper { @objc static let foreignIDKey = "wp_jp_foreign_id" diff --git a/Sources/WordPressData/Swift/ReaderCard+CoreDataClass.swift b/Sources/WordPressData/Swift/ReaderCard+CoreDataClass.swift index 82c6c7767794..4b1ff384d630 100644 --- a/Sources/WordPressData/Swift/ReaderCard+CoreDataClass.swift +++ b/Sources/WordPressData/Swift/ReaderCard+CoreDataClass.swift @@ -1,5 +1,6 @@ import Foundation import CoreData +import WordPressKit public class ReaderCard: NSManagedObject { public enum CardType { diff --git a/Sources/WordPressData/Swift/ReaderSiteInfoSubscriptions.swift b/Sources/WordPressData/Swift/ReaderSiteInfoSubscriptions.swift index a363798c7a79..700db5d1292e 100644 --- a/Sources/WordPressData/Swift/ReaderSiteInfoSubscriptions.swift +++ b/Sources/WordPressData/Swift/ReaderSiteInfoSubscriptions.swift @@ -1,5 +1,6 @@ import Foundation import CoreData +import WordPressKit @objc(ReaderSiteInfoSubscriptionPost) public class ReaderSiteInfoSubscriptionPost: NSManagedObject { diff --git a/Sources/WordPressData/Swift/ReaderSiteTopic.swift b/Sources/WordPressData/Swift/ReaderSiteTopic.swift index e277b3e10250..efa485f7a470 100644 --- a/Sources/WordPressData/Swift/ReaderSiteTopic.swift +++ b/Sources/WordPressData/Swift/ReaderSiteTopic.swift @@ -1,4 +1,5 @@ import Foundation +import WordPressKit @objc(ReaderSiteTopic) open class ReaderSiteTopic: ReaderAbstractTopic { diff --git a/Sources/WordPressData/Swift/ReaderTagTopic.swift b/Sources/WordPressData/Swift/ReaderTagTopic.swift index 20a8da233481..fc9da324175f 100644 --- a/Sources/WordPressData/Swift/ReaderTagTopic.swift +++ b/Sources/WordPressData/Swift/ReaderTagTopic.swift @@ -1,5 +1,6 @@ import Foundation import WordPressShared +import WordPressKit @objc(ReaderTagTopic) open class ReaderTagTopic: ReaderAbstractTopic { diff --git a/Sources/WordPressData/Swift/RemotePost+Metadata.swift b/Sources/WordPressData/Swift/RemotePost+Metadata.swift index df16ea60ffa0..53540dc166e7 100644 --- a/Sources/WordPressData/Swift/RemotePost+Metadata.swift +++ b/Sources/WordPressData/Swift/RemotePost+Metadata.swift @@ -1,5 +1,6 @@ import Foundation import WordPressShared +import WordPressKit @objc public extension RemotePost { diff --git a/Sources/WordPressData/Swift/Role.swift b/Sources/WordPressData/Swift/Role.swift index 925cb4a799ee..dbf1017f225b 100644 --- a/Sources/WordPressData/Swift/Role.swift +++ b/Sources/WordPressData/Swift/Role.swift @@ -1,5 +1,6 @@ import Foundation import CoreData +import WordPressKit public class Role: NSManagedObject { @NSManaged public var name: String! diff --git a/Tests/KeystoneTests/Tests/Services/PostRepositoryTests.swift b/Tests/KeystoneTests/Tests/Services/PostRepositoryTests.swift index cc26910b0c1d..9c894ae33b65 100644 --- a/Tests/KeystoneTests/Tests/Services/PostRepositoryTests.swift +++ b/Tests/KeystoneTests/Tests/Services/PostRepositoryTests.swift @@ -270,11 +270,6 @@ private class PostServiceRESTMock: PostServiceRemoteREST { var autoSaveStubbedBehavior = StubbedBehavior.success(nil) - // related to fetching likes - var fetchLikesShouldSucceed: Bool = true - var remoteUsersToReturnOnGetLikes = [RemoteLikeUser]() - var totalLikes: NSNumber = 1 - var deletePostResult: Result = .success(()) var trashPostResult: Result = .failure(NSError.testInstance()) var restorePostResult: Result = .failure(NSError.testInstance()) @@ -325,19 +320,6 @@ private class PostServiceRESTMock: PostServiceRemoteREST { } } - override func getLikesForPostID(_ postID: NSNumber, - count: NSNumber, - before: String?, - excludeUserIDs: [NSNumber]?, - success: (([RemoteLikeUser], NSNumber) -> Void)!, - failure: ((Error?) -> Void)!) { - if self.fetchLikesShouldSucceed { - success(self.remoteUsersToReturnOnGetLikes, self.totalLikes) - } else { - failure(nil) - } - } - override func delete(_ post: RemotePost!, success: (() -> Void)!, failure: ((Error?) -> Void)!) { switch deletePostResult { case let .failure(error): diff --git a/WordPress/Classes/Categories/Media+Extensions.m b/WordPress/Classes/Categories/Media+Extensions.m index a6ae9f9cd022..d2695aa0fdd8 100644 --- a/WordPress/Classes/Categories/Media+Extensions.m +++ b/WordPress/Classes/Categories/Media+Extensions.m @@ -2,6 +2,7 @@ #import "MediaService.h" @import WordPressData; @import WordPressShared; +@import WordPressKitModels; #import "WordPress-Swift.h" @implementation Media (Extensions) diff --git a/WordPress/Classes/Login/WordPressDotComAuthenticator.swift b/WordPress/Classes/Login/WordPressDotComAuthenticator.swift index 633f75bd9b78..26b4c5d832ed 100644 --- a/WordPress/Classes/Login/WordPressDotComAuthenticator.swift +++ b/WordPress/Classes/Login/WordPressDotComAuthenticator.swift @@ -5,6 +5,7 @@ import UIKit import SVProgressHUD import WordPressData import WordPressShared +import WordPressKit import BuildSettingsKit @preconcurrency import Combine @@ -138,7 +139,7 @@ struct WordPressDotComAuthenticator { // Fetch WP.com account details let user: RemoteUser do { - let service = AccountServiceRemoteREST(wordPressComRestApi: .defaultApi(oAuthToken: token, userAgent: WPUserAgent.wordPress())) + let service = AccountServiceRemoteREST(wordPressComRestApi: WordPressComRestApi.defaultApi(oAuthToken: token, userAgent: WPUserAgent.wordPress())) user = try await withCheckedThrowingContinuation { continuation in service.getAccountDetails(success: { continuation.resume(returning: $0!) }, failure: { continuation.resume(throwing: $0!) }) } diff --git a/WordPress/Classes/Models/Notifications/Notification+AppsTargets.swift b/WordPress/Classes/Models/Notifications/Notification+AppsTargets.swift index fc3c3bae367f..363ee7b05afe 100644 --- a/WordPress/Classes/Models/Notifications/Notification+AppsTargets.swift +++ b/WordPress/Classes/Models/Notifications/Notification+AppsTargets.swift @@ -1,5 +1,6 @@ import FormattableContentKit import WordPressData +import WordPressKit extension WordPressData.Notification { diff --git a/WordPress/Classes/Models/PublicizeConnection+Creation.swift b/WordPress/Classes/Models/PublicizeConnection+Creation.swift index 8adf8186a134..34413a8aeef9 100644 --- a/WordPress/Classes/Models/PublicizeConnection+Creation.swift +++ b/WordPress/Classes/Models/PublicizeConnection+Creation.swift @@ -1,5 +1,6 @@ import Foundation import WordPressData +import WordPressKit extension PublicizeConnection { diff --git a/WordPress/Classes/Models/WPAccount+AccountSettings.swift b/WordPress/Classes/Models/WPAccount+AccountSettings.swift index 69887505a11a..40cfa0d13494 100644 --- a/WordPress/Classes/Models/WPAccount+AccountSettings.swift +++ b/WordPress/Classes/Models/WPAccount+AccountSettings.swift @@ -1,6 +1,7 @@ import Foundation import BuildSettingsKit import WordPressData +import WordPressKit extension WPAccount { enum VerificationStatus: String { diff --git a/WordPress/Classes/Services/AccountService.h b/WordPress/Classes/Services/AccountService.h index 37981c797e56..d1ea256c9847 100644 --- a/WordPress/Classes/Services/AccountService.h +++ b/WordPress/Classes/Services/AccountService.h @@ -1,6 +1,8 @@ #import #import +@import WordPressKitModels; + NS_ASSUME_NONNULL_BEGIN @class WPAccount; diff --git a/WordPress/Classes/Services/AccountService.m b/WordPress/Classes/Services/AccountService.m index 76f717a0ddda..374cd0194285 100644 --- a/WordPress/Classes/Services/AccountService.m +++ b/WordPress/Classes/Services/AccountService.m @@ -3,6 +3,7 @@ @import WordPressData; @import WordPressKit; +@import WordPressKitModels; @import WordPressShared; #import "WordPress-Swift.h" diff --git a/WordPress/Classes/Services/BlogService+Swift.swift b/WordPress/Classes/Services/BlogService+Swift.swift index e18a4ef862de..4eaa3cec5771 100644 --- a/WordPress/Classes/Services/BlogService+Swift.swift +++ b/WordPress/Classes/Services/BlogService+Swift.swift @@ -1,5 +1,6 @@ import Foundation import WordPressData +import WordPressShared extension BlogService { @objc public func unscheduleBloggingReminders(for blog: Blog) { @@ -44,8 +45,13 @@ extension BlogService { } remoteUsers.forEach { - let blogAuthor = findBlogAuthor(with: $0.userID, and: blog, in: context) - blogAuthor.userID = $0.userID + guard let userID = $0.userID else { + wpAssertionFailure("user id must not be nil") + return + } + + let blogAuthor = findBlogAuthor(with: userID, and: blog, in: context) + blogAuthor.userID = userID blogAuthor.username = $0.username blogAuthor.email = $0.email blogAuthor.displayName = $0.displayName diff --git a/WordPress/Classes/Services/BlogService.m b/WordPress/Classes/Services/BlogService.m index 5c392ed787a6..2ec076a5b688 100644 --- a/WordPress/Classes/Services/BlogService.m +++ b/WordPress/Classes/Services/BlogService.m @@ -6,6 +6,7 @@ #import "WordPress-Swift.h" @import WordPressData; @import WordPressKit; +@import WordPressKitModels; @import WordPressShared; @class Comment; diff --git a/WordPress/Classes/Services/CommentService.h b/WordPress/Classes/Services/CommentService.h index 2aeab7c4534d..ff84f9ce9717 100644 --- a/WordPress/Classes/Services/CommentService.h +++ b/WordPress/Classes/Services/CommentService.h @@ -1,5 +1,6 @@ #import -#import + +@import WordPressKitObjC; NS_ASSUME_NONNULL_BEGIN @@ -10,7 +11,9 @@ extern NSUInteger const WPTopLevelHierarchicalCommentsPerPage; @class ReaderPost; @class BasePost; @class RemoteUser; +@class RemoteComment; @class CommentServiceRemoteFactory; +@class CommentServiceRemoteREST; @protocol CoreDataStack; @interface CommentService : NSObject diff --git a/WordPress/Classes/Services/CommentService.m b/WordPress/Classes/Services/CommentService.m index 59034f0f0d7a..06a86942a62b 100644 --- a/WordPress/Classes/Services/CommentService.m +++ b/WordPress/Classes/Services/CommentService.m @@ -2,6 +2,8 @@ #import "AccountService.h" #import "WordPress-Swift.h" @import WordPressData; +@import WordPressKit; +@import WordPressKitModels; @import WordPressShared; diff --git a/WordPress/Classes/Services/JetpackBackupService.swift b/WordPress/Classes/Services/JetpackBackupService.swift index 999c68de8bb5..875ba305d779 100644 --- a/WordPress/Classes/Services/JetpackBackupService.swift +++ b/WordPress/Classes/Services/JetpackBackupService.swift @@ -1,5 +1,6 @@ import Foundation import WordPressData +import WordPressKit class JetpackBackupService { diff --git a/WordPress/Classes/Services/JetpackRestoreService.swift b/WordPress/Classes/Services/JetpackRestoreService.swift index 29cbf0ee9590..e1b40b6d7e74 100644 --- a/WordPress/Classes/Services/JetpackRestoreService.swift +++ b/WordPress/Classes/Services/JetpackRestoreService.swift @@ -1,5 +1,6 @@ import Foundation import WordPressData +import WordPressKit class JetpackRestoreService { diff --git a/WordPress/Classes/Services/JetpackScanService.swift b/WordPress/Classes/Services/JetpackScanService.swift index c58d7e5ccd0a..a07216fac438 100644 --- a/WordPress/Classes/Services/JetpackScanService.swift +++ b/WordPress/Classes/Services/JetpackScanService.swift @@ -1,5 +1,6 @@ import Foundation import WordPressData +import WordPressKit class JetpackScanService { diff --git a/WordPress/Classes/Services/LikeUserHelpers.swift b/WordPress/Classes/Services/LikeUserHelpers.swift index 8632274662c0..f7237bfe0405 100644 --- a/WordPress/Classes/Services/LikeUserHelpers.swift +++ b/WordPress/Classes/Services/LikeUserHelpers.swift @@ -11,11 +11,11 @@ import WordPressKit @objc class func createOrUpdateFrom(remoteUser: RemoteLikeUser, context: NSManagedObjectContext) -> LikeUser { let liker = likeUser(for: remoteUser, context: context) ?? LikeUser(context: context) - liker.userID = remoteUser.userID.int64Value - liker.username = remoteUser.username - liker.displayName = remoteUser.displayName + liker.userID = remoteUser.userID?.int64Value ?? 0 + liker.username = remoteUser.username ?? "" + liker.displayName = remoteUser.displayName ?? "" liker.primaryBlogID = remoteUser.primaryBlogID?.int64Value ?? 0 - liker.avatarUrl = remoteUser.avatarURL + liker.avatarUrl = remoteUser.avatarURL ?? "" liker.bio = remoteUser.bio ?? "" liker.dateLikedString = remoteUser.dateLiked ?? "" liker.dateLiked = Date.dateFromServerDate(liker.dateLikedString) ?? .now diff --git a/WordPress/Classes/Services/MediaRepository.swift b/WordPress/Classes/Services/MediaRepository.swift index 109bef7983b6..fcb734c01c87 100644 --- a/WordPress/Classes/Services/MediaRepository.swift +++ b/WordPress/Classes/Services/MediaRepository.swift @@ -1,5 +1,6 @@ import Foundation import WordPressData +import WordPressKit final class MediaRepository { diff --git a/WordPress/Classes/Services/MediaService.h b/WordPress/Classes/Services/MediaService.h index 48eb7ffe4842..88825a2778fd 100644 --- a/WordPress/Classes/Services/MediaService.h +++ b/WordPress/Classes/Services/MediaService.h @@ -2,6 +2,7 @@ #import @import WordPressData; +@class Blog; @class Media; @class RemoteVideoPressVideo; @protocol ExportableAsset; diff --git a/WordPress/Classes/Services/MenusService.h b/WordPress/Classes/Services/MenusService.h index 0fe7400f7dbd..cc84b810a3a8 100644 --- a/WordPress/Classes/Services/MenusService.h +++ b/WordPress/Classes/Services/MenusService.h @@ -1,6 +1,11 @@ #import @import WordPressData; +@class Blog; +@class Menu; +@class MenuItem; +@class MenuLocation; + NS_ASSUME_NONNULL_BEGIN typedef void(^MenusServiceSuccessBlock)(void); diff --git a/WordPress/Classes/Services/MenusService.m b/WordPress/Classes/Services/MenusService.m index dfb98087c4f7..0d74524e39d6 100644 --- a/WordPress/Classes/Services/MenusService.m +++ b/WordPress/Classes/Services/MenusService.m @@ -2,6 +2,8 @@ #import "WordPress-Swift.h" @import WordPressData; @import WordPressKit; +@import WordPressKitObjC; +@import WordPressKitModels; @implementation MenusService diff --git a/WordPress/Classes/Services/PluginJetpackProxyService.swift b/WordPress/Classes/Services/PluginJetpackProxyService.swift index 0f6a4ab4f1d0..4df8a151776c 100644 --- a/WordPress/Classes/Services/PluginJetpackProxyService.swift +++ b/WordPress/Classes/Services/PluginJetpackProxyService.swift @@ -1,4 +1,5 @@ import WordPressData +import WordPressKit /// Plugin management service through the Jetpack Proxy. /// @@ -9,7 +10,7 @@ class PluginJetpackProxyService { private let remote: JetpackProxyServiceRemote init(remote: JetpackProxyServiceRemote? = nil) { - self.remote = remote ?? .init(wordPressComRestApi: .defaultApi(in: ContextManager.shared.mainContext)) + self.remote = remote ?? .init(wordPressComRestApi: WordPressComRestApi.defaultApi(in: ContextManager.shared.mainContext)) } // MARK: Methods diff --git a/WordPress/Classes/Services/PostService+Likes.swift b/WordPress/Classes/Services/PostService+Likes.swift index b3d5c475c384..0eb8a537ec65 100644 --- a/WordPress/Classes/Services/PostService+Likes.swift +++ b/WordPress/Classes/Services/PostService+Likes.swift @@ -1,4 +1,5 @@ import WordPressData +import WordPressKit extension PostService { diff --git a/WordPress/Classes/Services/PostService+Revisions.swift b/WordPress/Classes/Services/PostService+Revisions.swift index 9ccce8b4f262..8fed28963a6c 100644 --- a/WordPress/Classes/Services/PostService+Revisions.swift +++ b/WordPress/Classes/Services/PostService+Revisions.swift @@ -1,5 +1,6 @@ import Foundation import WordPressData +import WordPressKit extension PostService { diff --git a/WordPress/Classes/Services/PostTagService.h b/WordPress/Classes/Services/PostTagService.h index a11baed11aea..d40635a4a1cd 100644 --- a/WordPress/Classes/Services/PostTagService.h +++ b/WordPress/Classes/Services/PostTagService.h @@ -1,7 +1,11 @@ @import WordPressData; +@import CoreData; NS_ASSUME_NONNULL_BEGIN +@class Blog; +@class PostTag; + @interface PostTagService : LocalCoreDataService /** diff --git a/WordPress/Classes/Services/ReaderPostService+RelatedPosts.swift b/WordPress/Classes/Services/ReaderPostService+RelatedPosts.swift index d93294f17e96..ea1028080f96 100644 --- a/WordPress/Classes/Services/ReaderPostService+RelatedPosts.swift +++ b/WordPress/Classes/Services/ReaderPostService+RelatedPosts.swift @@ -1,5 +1,6 @@ import Foundation import WordPressData +import WordPressKit extension ReaderPostService { diff --git a/WordPress/Classes/Services/ReaderSiteSearchService.swift b/WordPress/Classes/Services/ReaderSiteSearchService.swift index 025191fd42c3..77a1533ac656 100644 --- a/WordPress/Classes/Services/ReaderSiteSearchService.swift +++ b/WordPress/Classes/Services/ReaderSiteSearchService.swift @@ -1,6 +1,7 @@ import Foundation import WordPressData import WordPressShared +import WordPressKit typealias ReaderSiteSearchSuccessBlock = (_ feeds: [ReaderFeed], _ hasMore: Bool, _ feedCount: Int) -> Void typealias ReaderSiteSearchFailureBlock = (_ error: Error?) -> Void diff --git a/WordPress/Classes/Services/ReaderTopicService+FollowedInterests.swift b/WordPress/Classes/Services/ReaderTopicService+FollowedInterests.swift index e7395c9495cf..31bcc1500d25 100644 --- a/WordPress/Classes/Services/ReaderTopicService+FollowedInterests.swift +++ b/WordPress/Classes/Services/ReaderTopicService+FollowedInterests.swift @@ -1,6 +1,7 @@ import Foundation import WordPressData import WordPressShared +import WordPressKit // MARK: - ReaderFollowedInterestsService diff --git a/WordPress/Classes/Services/ReaderTopicService+FollowedSites.swift b/WordPress/Classes/Services/ReaderTopicService+FollowedSites.swift index e3d0e268e35f..f79820009643 100644 --- a/WordPress/Classes/Services/ReaderTopicService+FollowedSites.swift +++ b/WordPress/Classes/Services/ReaderTopicService+FollowedSites.swift @@ -1,5 +1,6 @@ import WordPressData import WordPressShared +import WordPressKit extension ReaderTopicService { diff --git a/WordPress/Classes/Services/ReaderTopicService+SiteInfo.swift b/WordPress/Classes/Services/ReaderTopicService+SiteInfo.swift index b80e880f3a40..a4a5f1d3bf78 100644 --- a/WordPress/Classes/Services/ReaderTopicService+SiteInfo.swift +++ b/WordPress/Classes/Services/ReaderTopicService+SiteInfo.swift @@ -1,6 +1,7 @@ import Foundation import WordPressData import WordPressShared +import WordPressKit /// Protocol representing a service that retrieves the users followed interests/tags protocol ReaderSiteInfoService: AnyObject { diff --git a/WordPress/Classes/Services/ReaderTopicService.m b/WordPress/Classes/Services/ReaderTopicService.m index 7ee3826bf4f5..85be5be16287 100644 --- a/WordPress/Classes/Services/ReaderTopicService.m +++ b/WordPress/Classes/Services/ReaderTopicService.m @@ -4,6 +4,7 @@ #import "WordPress-Swift.h" @import WordPressData; @import WordPressKit; +@import WordPressKitModels; @import WordPressShared; NSString * const ReaderTopicFreshlyPressedPathCommponent = @"freshly-pressed"; diff --git a/WordPress/Classes/Services/SiteAssembly.swift b/WordPress/Classes/Services/SiteAssembly.swift index 71ed0b1cc4bb..b254bde07607 100644 --- a/WordPress/Classes/Services/SiteAssembly.swift +++ b/WordPress/Classes/Services/SiteAssembly.swift @@ -1,6 +1,6 @@ - import Foundation import WordPressData +import WordPressKit // MARK: - SiteAssembly diff --git a/WordPress/Classes/Services/SiteAssemblyService.swift b/WordPress/Classes/Services/SiteAssemblyService.swift index 325f2c2891aa..cc9165da0113 100644 --- a/WordPress/Classes/Services/SiteAssemblyService.swift +++ b/WordPress/Classes/Services/SiteAssemblyService.swift @@ -1,6 +1,7 @@ import Foundation import WordPressData import WordPressShared +import WordPressKit /// Site Creation Notification /// diff --git a/WordPress/Classes/Services/SiteManagementService.swift b/WordPress/Classes/Services/SiteManagementService.swift index d9412690b278..52b8c1a8f196 100644 --- a/WordPress/Classes/Services/SiteManagementService.swift +++ b/WordPress/Classes/Services/SiteManagementService.swift @@ -1,6 +1,7 @@ import CoreData import WordPressData import WordPressShared +import WordPressKit /// Site Deletion Notification /// diff --git a/WordPress/Classes/Stores/RemoteConfigStore.swift b/WordPress/Classes/Stores/RemoteConfigStore.swift index 7cb582e9c0cf..581b54e5e3ab 100644 --- a/WordPress/Classes/Stores/RemoteConfigStore.swift +++ b/WordPress/Classes/Stores/RemoteConfigStore.swift @@ -19,7 +19,7 @@ class RemoteConfigStore { // MARK: Initializer init(queue: DispatchQueue = .remoteConfigStoreQueue, - remote: RemoteConfigRemote = RemoteConfigRemote(wordPressComRestApi: .defaultApi()), + remote: RemoteConfigRemote = RemoteConfigRemote(wordPressComRestApi: WordPressComRestApi.defaultApi()), persistenceStore: UserPersistentRepository = UserDefaults.standard) { self.queue = queue self.remote = remote diff --git a/WordPress/Classes/Stores/StatsWidgetsStore.swift b/WordPress/Classes/Stores/StatsWidgetsStore.swift index 2ffd47dbed58..49964e8b51ef 100644 --- a/WordPress/Classes/Stores/StatsWidgetsStore.swift +++ b/WordPress/Classes/Stores/StatsWidgetsStore.swift @@ -4,6 +4,7 @@ import BuildSettingsKit import SFHFKeychainUtils import WidgetKit import WordPressData +import WordPressKit class StatsWidgetsStore { private let coreDataStack: CoreDataStack diff --git a/WordPress/Classes/System/WordPress-Bridging-Header.h b/WordPress/Classes/System/WordPress-Bridging-Header.h index d76db2d76094..6d2bb589fb15 100644 --- a/WordPress/Classes/System/WordPress-Bridging-Header.h +++ b/WordPress/Classes/System/WordPress-Bridging-Header.h @@ -1,5 +1,8 @@ // WordPress Module +@import WordPressKit; +@import WordPressData; + #import "AccountService.h" #import "BlogService.h" diff --git a/WordPress/Classes/Utility/Automated Transfer/AutomatedTransferHelper.swift b/WordPress/Classes/Utility/Automated Transfer/AutomatedTransferHelper.swift index dc4f6f8ce1a3..9c52fa2621d8 100644 --- a/WordPress/Classes/Utility/Automated Transfer/AutomatedTransferHelper.swift +++ b/WordPress/Classes/Utility/Automated Transfer/AutomatedTransferHelper.swift @@ -3,6 +3,7 @@ import SVProgressHUD import WordPressData import WordPressFlux import WordPressShared +import WordPressKit class AutomatedTransferHelper { diff --git a/WordPress/Classes/Utility/BackgroundTasks/WeeklyRoundupBackgroundTask.swift b/WordPress/Classes/Utility/BackgroundTasks/WeeklyRoundupBackgroundTask.swift index e54fdd011ead..1dc2276756e2 100644 --- a/WordPress/Classes/Utility/BackgroundTasks/WeeklyRoundupBackgroundTask.swift +++ b/WordPress/Classes/Utility/BackgroundTasks/WeeklyRoundupBackgroundTask.swift @@ -2,6 +2,7 @@ import CoreData import Foundation import WordPressData import WordPressShared +import WordPressKit /// The main data provider for Weekly Roundup information. /// diff --git a/WordPress/Classes/Utility/Sharing/ShareExtensionSessionManager.swift b/WordPress/Classes/Utility/Sharing/ShareExtensionSessionManager.swift index 366532da1df7..46eb9ab3f496 100644 --- a/WordPress/Classes/Utility/Sharing/ShareExtensionSessionManager.swift +++ b/WordPress/Classes/Utility/Sharing/ShareExtensionSessionManager.swift @@ -6,6 +6,7 @@ import Foundation import ShareExtensionCore import WordPressData import WordPressFlux +import WordPressKit /// Manages URLSessions initiated by the share extension /// diff --git a/WordPress/Classes/ViewRelated/Activity/Details/ActivityFormattableContentView.swift b/WordPress/Classes/ViewRelated/Activity/Details/ActivityFormattableContentView.swift index 086aa2da2e1c..935176e91e9b 100644 --- a/WordPress/Classes/ViewRelated/Activity/Details/ActivityFormattableContentView.swift +++ b/WordPress/Classes/ViewRelated/Activity/Details/ActivityFormattableContentView.swift @@ -1,6 +1,7 @@ import SwiftUI import UIKit import WordPressUI +import WordPressData import FormattableContentKit struct ActivityFormattableContentView: UIViewRepresentable { diff --git a/WordPress/Classes/ViewRelated/Activity/Details/ActivityLogDetailsCoordinator.swift b/WordPress/Classes/ViewRelated/Activity/Details/ActivityLogDetailsCoordinator.swift index 47755b08526c..28261db07ab5 100644 --- a/WordPress/Classes/ViewRelated/Activity/Details/ActivityLogDetailsCoordinator.swift +++ b/WordPress/Classes/ViewRelated/Activity/Details/ActivityLogDetailsCoordinator.swift @@ -1,6 +1,7 @@ import UIKit import SwiftUI import WordPressKit +import WordPressData /// Coordinator to handle navigation from SwiftUI ActivityLogDetailsView to UIKit view controllers enum ActivityLogDetailsCoordinator { diff --git a/WordPress/Classes/ViewRelated/Activity/Details/ActivityLogDetailsView.swift b/WordPress/Classes/ViewRelated/Activity/Details/ActivityLogDetailsView.swift index e921ab95b2b1..0603ab6238b1 100644 --- a/WordPress/Classes/ViewRelated/Activity/Details/ActivityLogDetailsView.swift +++ b/WordPress/Classes/ViewRelated/Activity/Details/ActivityLogDetailsView.swift @@ -2,6 +2,7 @@ import SwiftUI import WordPressKit import WordPressUI import WordPressShared +import WordPressData import Gridicons import UIKit diff --git a/WordPress/Classes/ViewRelated/Activity/FormattableContent/FormattableActivity.swift b/WordPress/Classes/ViewRelated/Activity/FormattableContent/FormattableActivity.swift index 21ca4af9739c..8f66867ab0e1 100644 --- a/WordPress/Classes/ViewRelated/Activity/FormattableContent/FormattableActivity.swift +++ b/WordPress/Classes/ViewRelated/Activity/FormattableContent/FormattableActivity.swift @@ -1,5 +1,6 @@ import FormattableContentKit import WordPressData +import WordPressKit class FormattableActivity { let activity: Activity diff --git a/WordPress/Classes/ViewRelated/Activity/List/ActivityLogsView.swift b/WordPress/Classes/ViewRelated/Activity/List/ActivityLogsView.swift index a619041c18f8..ed32aa3740d8 100644 --- a/WordPress/Classes/ViewRelated/Activity/List/ActivityLogsView.swift +++ b/WordPress/Classes/ViewRelated/Activity/List/ActivityLogsView.swift @@ -2,6 +2,7 @@ import SwiftUI import WordPressUI import WordPressKit import WordPressShared +import WordPressData struct ActivityLogsView: View { @ObservedObject var viewModel: ActivityLogsViewModel diff --git a/WordPress/Classes/ViewRelated/Activity/List/ActivityLogsViewController.swift b/WordPress/Classes/ViewRelated/Activity/List/ActivityLogsViewController.swift index b80b8cb1b367..64b7b5a935fa 100644 --- a/WordPress/Classes/ViewRelated/Activity/List/ActivityLogsViewController.swift +++ b/WordPress/Classes/ViewRelated/Activity/List/ActivityLogsViewController.swift @@ -2,6 +2,7 @@ import UIKit import SwiftUI import WordPressUI import WordPressKit +import WordPressData final class ActivityLogsViewController: UIHostingController { private let viewModel: ActivityLogsViewModel diff --git a/WordPress/Classes/ViewRelated/Activity/List/ActivityLogsViewModel.swift b/WordPress/Classes/ViewRelated/Activity/List/ActivityLogsViewModel.swift index 4a32bad4a7a5..44cedcf24e32 100644 --- a/WordPress/Classes/ViewRelated/Activity/List/ActivityLogsViewModel.swift +++ b/WordPress/Classes/ViewRelated/Activity/List/ActivityLogsViewModel.swift @@ -2,6 +2,7 @@ import Foundation import WordPressKit import WordPressUI import WordPressShared +import WordPressData typealias ActivityLogsPaginatedResponse = DataViewPaginatedResponse diff --git a/WordPress/Classes/ViewRelated/Activity/List/DownloadableBackupTracker.swift b/WordPress/Classes/ViewRelated/Activity/List/DownloadableBackupTracker.swift index 809d81a4534d..90ce659d8036 100644 --- a/WordPress/Classes/ViewRelated/Activity/List/DownloadableBackupTracker.swift +++ b/WordPress/Classes/ViewRelated/Activity/List/DownloadableBackupTracker.swift @@ -1,6 +1,7 @@ import Foundation import WordPressKit import WordPressShared +import WordPressData import CocoaLumberjack /// Tracks backup download status for a WordPress site. diff --git a/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Activity Log/DashboardActivityLogCardCell.swift b/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Activity Log/DashboardActivityLogCardCell.swift index 67020910982c..97e1344b4dbd 100644 --- a/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Activity Log/DashboardActivityLogCardCell.swift +++ b/WordPress/Classes/ViewRelated/Blog/Blog Dashboard/Cards/Activity Log/DashboardActivityLogCardCell.swift @@ -2,6 +2,7 @@ import UIKit import SwiftUI import WordPressData import WordPressShared +import WordPressKit final class DashboardActivityLogCardCell: DashboardCollectionViewCell { diff --git a/WordPress/Classes/ViewRelated/Blog/Site Monitoring/SiteMonitoringEntryDetailsView.swift b/WordPress/Classes/ViewRelated/Blog/Site Monitoring/SiteMonitoringEntryDetailsView.swift index b231cef2c81f..cf5cb91ca3dc 100644 --- a/WordPress/Classes/ViewRelated/Blog/Site Monitoring/SiteMonitoringEntryDetailsView.swift +++ b/WordPress/Classes/ViewRelated/Blog/Site Monitoring/SiteMonitoringEntryDetailsView.swift @@ -1,5 +1,6 @@ import SwiftUI import WordPressData +import WordPressKit struct SiteMonitoringEntryDetailsView: View { let text: NSAttributedString diff --git a/WordPress/Classes/ViewRelated/Blog/Subscribers/List/SubscribersMenu.swift b/WordPress/Classes/ViewRelated/Blog/Subscribers/List/SubscribersMenu.swift index ac63b0a68314..0dca241c3ca0 100644 --- a/WordPress/Classes/ViewRelated/Blog/Subscribers/List/SubscribersMenu.swift +++ b/WordPress/Classes/ViewRelated/Blog/Subscribers/List/SubscribersMenu.swift @@ -1,4 +1,5 @@ import SwiftUI +import WordPressKit struct SubscribersFiltersMenu: View { @ObservedObject var viewModel: SubscribersViewModel diff --git a/WordPress/Classes/ViewRelated/Domains/Domain registration/RegisterDomainDetails/ViewModel/RegisterDomainDetailsServiceProxy.swift b/WordPress/Classes/ViewRelated/Domains/Domain registration/RegisterDomainDetails/ViewModel/RegisterDomainDetailsServiceProxy.swift index ef1c7daa549a..23d7c8622361 100644 --- a/WordPress/Classes/ViewRelated/Domains/Domain registration/RegisterDomainDetails/ViewModel/RegisterDomainDetailsServiceProxy.swift +++ b/WordPress/Classes/ViewRelated/Domains/Domain registration/RegisterDomainDetails/ViewModel/RegisterDomainDetailsServiceProxy.swift @@ -1,6 +1,7 @@ import Foundation import CoreData import WordPressData +import WordPressKit /// Protocol for cart response, empty because there are no external details. protocol CartResponseProtocol {} diff --git a/WordPress/Classes/ViewRelated/Domains/Domain registration/SiteCreationPurchasingWebFlowController.swift b/WordPress/Classes/ViewRelated/Domains/Domain registration/SiteCreationPurchasingWebFlowController.swift index d60f57116606..6122c2b7acea 100644 --- a/WordPress/Classes/ViewRelated/Domains/Domain registration/SiteCreationPurchasingWebFlowController.swift +++ b/WordPress/Classes/ViewRelated/Domains/Domain registration/SiteCreationPurchasingWebFlowController.swift @@ -3,6 +3,7 @@ import AutomatticTracks import Sentry import WordPressData import WordPressShared +import WordPressKit import WebKit final class SiteCreationPurchasingWebFlowController { diff --git a/WordPress/Classes/ViewRelated/Domains/Utility/Blog+DomainsDashboardView.swift b/WordPress/Classes/ViewRelated/Domains/Utility/Blog+DomainsDashboardView.swift index 88d6fbf3c57e..f8c6429add24 100644 --- a/WordPress/Classes/ViewRelated/Domains/Utility/Blog+DomainsDashboardView.swift +++ b/WordPress/Classes/ViewRelated/Domains/Utility/Blog+DomainsDashboardView.swift @@ -1,4 +1,5 @@ import WordPressData +import WordPressKit /// Collection of convenience properties used in the Domains Dashboard extension Blog { diff --git a/WordPress/Classes/ViewRelated/Gutenberg/EditorMediaUtility.swift b/WordPress/Classes/ViewRelated/Gutenberg/EditorMediaUtility.swift index e59f16ec7e74..d269f5219993 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/EditorMediaUtility.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/EditorMediaUtility.swift @@ -3,6 +3,7 @@ import Aztec import Gridicons import WordPressData import WordPressShared +import WordPressKit import AsyncImageKit class EditorMediaUtility { diff --git a/WordPress/Classes/ViewRelated/Jetpack/Install/ViewModel/WPComJetpackRemoteInstallViewModel.swift b/WordPress/Classes/ViewRelated/Jetpack/Install/ViewModel/WPComJetpackRemoteInstallViewModel.swift index 988a26c412de..552e0517d9f8 100644 --- a/WordPress/Classes/ViewRelated/Jetpack/Install/ViewModel/WPComJetpackRemoteInstallViewModel.swift +++ b/WordPress/Classes/ViewRelated/Jetpack/Install/ViewModel/WPComJetpackRemoteInstallViewModel.swift @@ -1,5 +1,6 @@ import WordPressAuthenticator import WordPressData +import WordPressKit /// Controls the Jetpack Remote Install flow for Jetpack-connected self-hosted sites. /// diff --git a/WordPress/Classes/ViewRelated/Jetpack/Jetpack Restore/Restore Complete/JetpackBackupCompleteViewController.swift b/WordPress/Classes/ViewRelated/Jetpack/Jetpack Restore/Restore Complete/JetpackBackupCompleteViewController.swift index f40ef840cd19..a3fd839676ce 100644 --- a/WordPress/Classes/ViewRelated/Jetpack/Jetpack Restore/Restore Complete/JetpackBackupCompleteViewController.swift +++ b/WordPress/Classes/ViewRelated/Jetpack/Jetpack Restore/Restore Complete/JetpackBackupCompleteViewController.swift @@ -3,6 +3,7 @@ import WordPressData import WordPressFlux import WordPressShared import WordPressUI +import WordPressKit class JetpackBackupCompleteViewController: BaseRestoreCompleteViewController { diff --git a/WordPress/Classes/ViewRelated/Jetpack/Jetpack Restore/Restore Options/Coordinators/JetpackBackupOptionsCoordinator.swift b/WordPress/Classes/ViewRelated/Jetpack/Jetpack Restore/Restore Options/Coordinators/JetpackBackupOptionsCoordinator.swift index 1760e358957f..8ff9c316c94f 100644 --- a/WordPress/Classes/ViewRelated/Jetpack/Jetpack Restore/Restore Options/Coordinators/JetpackBackupOptionsCoordinator.swift +++ b/WordPress/Classes/ViewRelated/Jetpack/Jetpack Restore/Restore Options/Coordinators/JetpackBackupOptionsCoordinator.swift @@ -1,6 +1,7 @@ import Foundation import WordPressData import WordPressShared +import WordPressKit protocol JetpackBackupOptionsView { func showNoInternetConnection() diff --git a/WordPress/Classes/ViewRelated/Jetpack/Jetpack Restore/Restore Status/BaseRestoreStatusViewController.swift b/WordPress/Classes/ViewRelated/Jetpack/Jetpack Restore/Restore Status/BaseRestoreStatusViewController.swift index 7dc858d4baff..6ee40b839b91 100644 --- a/WordPress/Classes/ViewRelated/Jetpack/Jetpack Restore/Restore Status/BaseRestoreStatusViewController.swift +++ b/WordPress/Classes/ViewRelated/Jetpack/Jetpack Restore/Restore Status/BaseRestoreStatusViewController.swift @@ -2,6 +2,7 @@ import Foundation import WordPressUI import WordPressData import WordPressShared +import WordPressKit struct JetpackRestoreStatusConfiguration { let title: String diff --git a/WordPress/Classes/ViewRelated/Jetpack/Jetpack Restore/Restore Status/Coordinators/JetpackBackupStatusCoordinator.swift b/WordPress/Classes/ViewRelated/Jetpack/Jetpack Restore/Restore Status/Coordinators/JetpackBackupStatusCoordinator.swift index 9a20e593948f..908ee3fe0d65 100644 --- a/WordPress/Classes/ViewRelated/Jetpack/Jetpack Restore/Restore Status/Coordinators/JetpackBackupStatusCoordinator.swift +++ b/WordPress/Classes/ViewRelated/Jetpack/Jetpack Restore/Restore Status/Coordinators/JetpackBackupStatusCoordinator.swift @@ -1,5 +1,6 @@ import Foundation import WordPressData +import WordPressKit protocol JetpackBackupStatusView { func render(_ backup: JetpackBackup) diff --git a/WordPress/Classes/ViewRelated/Jetpack/Jetpack Restore/Restore Warning/Coordinators/JetpackRestoreWarningCoordinator.swift b/WordPress/Classes/ViewRelated/Jetpack/Jetpack Restore/Restore Warning/Coordinators/JetpackRestoreWarningCoordinator.swift index b7ac85b4faee..b23fdc3e0393 100644 --- a/WordPress/Classes/ViewRelated/Jetpack/Jetpack Restore/Restore Warning/Coordinators/JetpackRestoreWarningCoordinator.swift +++ b/WordPress/Classes/ViewRelated/Jetpack/Jetpack Restore/Restore Warning/Coordinators/JetpackRestoreWarningCoordinator.swift @@ -1,6 +1,7 @@ import Foundation import WordPressData import WordPressShared +import WordPressKit protocol JetpackRestoreWarningView { func showNoInternetConnection() diff --git a/WordPress/Classes/ViewRelated/Jetpack/Jetpack Scan/JetpackScanCoordinator.swift b/WordPress/Classes/ViewRelated/Jetpack/Jetpack Scan/JetpackScanCoordinator.swift index ee4602a89e55..4a59f5caf692 100644 --- a/WordPress/Classes/ViewRelated/Jetpack/Jetpack Scan/JetpackScanCoordinator.swift +++ b/WordPress/Classes/ViewRelated/Jetpack/Jetpack Scan/JetpackScanCoordinator.swift @@ -1,6 +1,7 @@ import Foundation import WordPressData import WordPressShared +import WordPressKit protocol JetpackScanView { func render() diff --git a/WordPress/Classes/ViewRelated/Jetpack/Jetpack Scan/JetpackScanHistoryCoordinator.swift b/WordPress/Classes/ViewRelated/Jetpack/Jetpack Scan/JetpackScanHistoryCoordinator.swift index 67ae16bcda85..358a71d87045 100644 --- a/WordPress/Classes/ViewRelated/Jetpack/Jetpack Scan/JetpackScanHistoryCoordinator.swift +++ b/WordPress/Classes/ViewRelated/Jetpack/Jetpack Scan/JetpackScanHistoryCoordinator.swift @@ -1,6 +1,7 @@ import Foundation import WordPressData import WordPressShared +import WordPressKit class JetpackScanHistoryCoordinator { private let service: JetpackScanService diff --git a/WordPress/Classes/ViewRelated/Jetpack/Jetpack Scan/JetpackScanHistoryViewController.swift b/WordPress/Classes/ViewRelated/Jetpack/Jetpack Scan/JetpackScanHistoryViewController.swift index 9dddb8135702..83fce403ef1b 100644 --- a/WordPress/Classes/ViewRelated/Jetpack/Jetpack Scan/JetpackScanHistoryViewController.swift +++ b/WordPress/Classes/ViewRelated/Jetpack/Jetpack Scan/JetpackScanHistoryViewController.swift @@ -1,6 +1,7 @@ import UIKit import WordPressData import WordPressUI +import WordPressKit class JetpackScanHistoryViewController: UIViewController { private let blog: Blog diff --git a/WordPress/Classes/ViewRelated/Jetpack/Jetpack Scan/JetpackScanThreatDetailsViewController.swift b/WordPress/Classes/ViewRelated/Jetpack/Jetpack Scan/JetpackScanThreatDetailsViewController.swift index 46604ed46eec..01a82c0bdf68 100644 --- a/WordPress/Classes/ViewRelated/Jetpack/Jetpack Scan/JetpackScanThreatDetailsViewController.swift +++ b/WordPress/Classes/ViewRelated/Jetpack/Jetpack Scan/JetpackScanThreatDetailsViewController.swift @@ -2,6 +2,7 @@ import UIKit import WordPressData import WordPressFlux import WordPressUI +import WordPressKit protocol JetpackScanThreatDetailsViewControllerDelegate: AnyObject { func willFixThreat(_ threat: JetpackScanThreat, controller: JetpackScanThreatDetailsViewController) diff --git a/WordPress/Classes/ViewRelated/Jetpack/Jetpack Scan/JetpackScanViewController.swift b/WordPress/Classes/ViewRelated/Jetpack/Jetpack Scan/JetpackScanViewController.swift index b092e02d4689..9b8e93980934 100644 --- a/WordPress/Classes/ViewRelated/Jetpack/Jetpack Scan/JetpackScanViewController.swift +++ b/WordPress/Classes/ViewRelated/Jetpack/Jetpack Scan/JetpackScanViewController.swift @@ -2,6 +2,7 @@ import UIKit import WordPressData import WordPressFlux import WordPressUI +import WordPressKit class JetpackScanViewController: UIViewController, JetpackScanView { private let blog: Blog diff --git a/WordPress/Classes/ViewRelated/Me/Account Settings/AccountSettingsViewController.swift b/WordPress/Classes/ViewRelated/Me/Account Settings/AccountSettingsViewController.swift index 7ed5f0058960..1bd9a05d3ff9 100644 --- a/WordPress/Classes/ViewRelated/Me/Account Settings/AccountSettingsViewController.swift +++ b/WordPress/Classes/ViewRelated/Me/Account Settings/AccountSettingsViewController.swift @@ -5,6 +5,7 @@ import WordPressData import WordPressShared import WordPressFlux import WordPressUI +import WordPressKit func AccountSettingsViewController(account: WPAccount) -> ImmuTableViewController? { guard let api = account.wordPressComRestApi, let userID = account.userID else { diff --git a/WordPress/Classes/ViewRelated/Me/App Settings/Privacy Settings/PrivacySettingsViewController.swift b/WordPress/Classes/ViewRelated/Me/App Settings/Privacy Settings/PrivacySettingsViewController.swift index 86fa5d09a3dc..22bf959206c4 100644 --- a/WordPress/Classes/ViewRelated/Me/App Settings/Privacy Settings/PrivacySettingsViewController.swift +++ b/WordPress/Classes/ViewRelated/Me/App Settings/Privacy Settings/PrivacySettingsViewController.swift @@ -3,6 +3,7 @@ import UIKit import AutomatticTracks import WordPressData import WordPressUI +import WordPressKit class PrivacySettingsViewController: UITableViewController { fileprivate var handler: ImmuTableViewHandler! diff --git a/WordPress/Classes/ViewRelated/Me/Domain Details/DomainDetailsWebViewController.swift b/WordPress/Classes/ViewRelated/Me/Domain Details/DomainDetailsWebViewController.swift index c9b7bb1bf56e..ced618d3f2e6 100644 --- a/WordPress/Classes/ViewRelated/Me/Domain Details/DomainDetailsWebViewController.swift +++ b/WordPress/Classes/ViewRelated/Me/Domain Details/DomainDetailsWebViewController.swift @@ -1,6 +1,7 @@ import Foundation import WordPressData import WordPressShared +import WordPressKit final class DomainDetailsWebViewController: WebKitViewController { diff --git a/WordPress/Classes/ViewRelated/Media/MediaPicker/Helpers/MediaPickerMenuController.swift b/WordPress/Classes/ViewRelated/Media/MediaPicker/Helpers/MediaPickerMenuController.swift index 4f76d7b9e222..b3541871521c 100644 --- a/WordPress/Classes/ViewRelated/Media/MediaPicker/Helpers/MediaPickerMenuController.swift +++ b/WordPress/Classes/ViewRelated/Media/MediaPicker/Helpers/MediaPickerMenuController.swift @@ -1,6 +1,7 @@ import Photos import PhotosUI import WordPressShared +import WordPressData final class MediaPickerMenuController: NSObject { var onSelection: ((MediaPickerSelection) -> Void)? diff --git a/WordPress/Classes/ViewRelated/Menus/Categories/Menu+ViewDesign.h b/WordPress/Classes/ViewRelated/Menus/Categories/Menu+ViewDesign.h index 86d730eb3a85..a7b797fb5dcd 100644 --- a/WordPress/Classes/ViewRelated/Menus/Categories/Menu+ViewDesign.h +++ b/WordPress/Classes/ViewRelated/Menus/Categories/Menu+ViewDesign.h @@ -1,6 +1,5 @@ @import UIKit; - -#import "Menu.h" +@import WordPressData; NS_ASSUME_NONNULL_BEGIN diff --git a/WordPress/Classes/ViewRelated/Menus/Categories/MenuItem+ViewDesign.h b/WordPress/Classes/ViewRelated/Menus/Categories/MenuItem+ViewDesign.h index 5964410e3744..159ef9be8b7f 100644 --- a/WordPress/Classes/ViewRelated/Menus/Categories/MenuItem+ViewDesign.h +++ b/WordPress/Classes/ViewRelated/Menus/Categories/MenuItem+ViewDesign.h @@ -1,5 +1,4 @@ @import WordPressData; -#import "Menu+ViewDesign.h" NS_ASSUME_NONNULL_BEGIN diff --git a/WordPress/Classes/ViewRelated/Menus/Views/MenuItemAbstractView.m b/WordPress/Classes/ViewRelated/Menus/Views/MenuItemAbstractView.m index dd24e7fd7eb3..50f8fca6c1b9 100644 --- a/WordPress/Classes/ViewRelated/Menus/Views/MenuItemAbstractView.m +++ b/WordPress/Classes/ViewRelated/Menus/Views/MenuItemAbstractView.m @@ -1,5 +1,6 @@ #import "MenuItemAbstractView.h" #import "MenuItem+ViewDesign.h" +#import "Menu+ViewDesign.h" #import "WordPress-Swift.h" @import WordPressUI; @import WordPressShared; diff --git a/WordPress/Classes/ViewRelated/Menus/Views/MenuItemEditingHeaderView.m b/WordPress/Classes/ViewRelated/Menus/Views/MenuItemEditingHeaderView.m index 8fb6a0bfc61e..4c91ab02cf7c 100644 --- a/WordPress/Classes/ViewRelated/Menus/Views/MenuItemEditingHeaderView.m +++ b/WordPress/Classes/ViewRelated/Menus/Views/MenuItemEditingHeaderView.m @@ -1,5 +1,6 @@ #import "MenuItemEditingHeaderView.h" #import "MenuItem+ViewDesign.h" +#import "Menu+ViewDesign.h" #import "WordPress-Swift.h" @import WordPressData; diff --git a/WordPress/Classes/ViewRelated/Menus/Views/MenuItemSourceHeaderView.m b/WordPress/Classes/ViewRelated/Menus/Views/MenuItemSourceHeaderView.m index e4d123feac48..0c367d918172 100644 --- a/WordPress/Classes/ViewRelated/Menus/Views/MenuItemSourceHeaderView.m +++ b/WordPress/Classes/ViewRelated/Menus/Views/MenuItemSourceHeaderView.m @@ -1,5 +1,6 @@ #import "MenuItemSourceHeaderView.h" #import "MenuItem+ViewDesign.h" +#import "Menu+ViewDesign.h" #import "MenuItem.h" #import "WordPress-Swift.h" @import WordPressData; diff --git a/WordPress/Classes/ViewRelated/NUX/Helpers/WordPressAuthenticationManager.swift b/WordPress/Classes/ViewRelated/NUX/Helpers/WordPressAuthenticationManager.swift index 745564fdb748..8ae3766410a2 100644 --- a/WordPress/Classes/ViewRelated/NUX/Helpers/WordPressAuthenticationManager.swift +++ b/WordPress/Classes/ViewRelated/NUX/Helpers/WordPressAuthenticationManager.swift @@ -9,6 +9,7 @@ import WordPressShared import WordPressUI import WordPressCore import WordPressAPI +import WordPressKit import Gridicons // MARK: - WordPressAuthenticationManager diff --git a/WordPress/Classes/ViewRelated/People/Controllers/PeopleViewController.swift b/WordPress/Classes/ViewRelated/People/Controllers/PeopleViewController.swift index 904e864d5b72..6c26fd7ef385 100644 --- a/WordPress/Classes/ViewRelated/People/Controllers/PeopleViewController.swift +++ b/WordPress/Classes/ViewRelated/People/Controllers/PeopleViewController.swift @@ -3,6 +3,7 @@ import Combine import WordPressData import WordPressShared import WordPressUI +import WordPressKit // MARK: - PeopleViewController diff --git a/WordPress/Classes/ViewRelated/People/Controllers/PersonViewController.swift b/WordPress/Classes/ViewRelated/People/Controllers/PersonViewController.swift index 477e6b31d227..266626388fa2 100644 --- a/WordPress/Classes/ViewRelated/People/Controllers/PersonViewController.swift +++ b/WordPress/Classes/ViewRelated/People/Controllers/PersonViewController.swift @@ -3,6 +3,7 @@ import UIKit import WordPressData import WordPressShared import WordPressUI +import WordPressKit import Gravatar /// Displays a Blog's User Details diff --git a/WordPress/Classes/ViewRelated/People/Controllers/RoleViewController.swift b/WordPress/Classes/ViewRelated/People/Controllers/RoleViewController.swift index db629ad379c2..ef283fd36fa6 100644 --- a/WordPress/Classes/ViewRelated/People/Controllers/RoleViewController.swift +++ b/WordPress/Classes/ViewRelated/People/Controllers/RoleViewController.swift @@ -2,6 +2,7 @@ import Foundation import UIKit import WordPressData import WordPressShared +import WordPressKit /// Displays a Person Role Picker /// diff --git a/WordPress/Classes/ViewRelated/Post/PostEditor+Publish.swift b/WordPress/Classes/ViewRelated/Post/PostEditor+Publish.swift index 91bc28af1d85..991f1e1d8458 100644 --- a/WordPress/Classes/ViewRelated/Post/PostEditor+Publish.swift +++ b/WordPress/Classes/ViewRelated/Post/PostEditor+Publish.swift @@ -4,6 +4,7 @@ import WordPressData import WordPressFlux import WordPressUI import WordPressShared +import WordPressKit protocol PublishingEditor where Self: UIViewController { var post: AbstractPost { get set } diff --git a/WordPress/Classes/ViewRelated/Post/Preview/PreviewNonceHandler.swift b/WordPress/Classes/ViewRelated/Post/Preview/PreviewNonceHandler.swift index 2e5d6a7ac2d8..3dd0bb9206ba 100644 --- a/WordPress/Classes/ViewRelated/Post/Preview/PreviewNonceHandler.swift +++ b/WordPress/Classes/ViewRelated/Post/Preview/PreviewNonceHandler.swift @@ -1,5 +1,6 @@ import Foundation import WordPressData +import WordPressKit struct PreviewNonceHandler { static func nonceURL(post: AbstractPost, previewURL: URL?) -> URL? { diff --git a/WordPress/Classes/ViewRelated/Reader/Cards/Tags View/ReaderTopicCollectionViewCoordinator.swift b/WordPress/Classes/ViewRelated/Reader/Cards/Tags View/ReaderTopicCollectionViewCoordinator.swift index 03c6268038bb..5fbc081a0319 100644 --- a/WordPress/Classes/ViewRelated/Reader/Cards/Tags View/ReaderTopicCollectionViewCoordinator.swift +++ b/WordPress/Classes/ViewRelated/Reader/Cards/Tags View/ReaderTopicCollectionViewCoordinator.swift @@ -1,6 +1,7 @@ import UIKit import WordPressReader import WordPressShared +import WordPressKit enum ReaderTopicCollectionViewState { case collapsed diff --git a/WordPress/Classes/ViewRelated/Reader/Comments/ReaderCommentsViewController.swift b/WordPress/Classes/ViewRelated/Reader/Comments/ReaderCommentsViewController.swift index 0648cd8680c8..e89cb53de6cc 100644 --- a/WordPress/Classes/ViewRelated/Reader/Comments/ReaderCommentsViewController.swift +++ b/WordPress/Classes/ViewRelated/Reader/Comments/ReaderCommentsViewController.swift @@ -4,6 +4,7 @@ import SwiftUI import WordPressData import WordPressShared import WordPressUI +import WordPressKit // Notification sent when a comment is moderated/edited to allow views that display Comments to update if necessary. // Specifically, the Comments snippet on ReaderDetailViewController. diff --git a/WordPress/Classes/ViewRelated/Reader/Controllers/ReaderPostActions/ReaderSubscribingNotificationAction.swift b/WordPress/Classes/ViewRelated/Reader/Controllers/ReaderPostActions/ReaderSubscribingNotificationAction.swift index 4f63677fc8f1..746b00296974 100644 --- a/WordPress/Classes/ViewRelated/Reader/Controllers/ReaderPostActions/ReaderSubscribingNotificationAction.swift +++ b/WordPress/Classes/ViewRelated/Reader/Controllers/ReaderPostActions/ReaderSubscribingNotificationAction.swift @@ -1,5 +1,6 @@ import Foundation import WordPressData +import WordPressKit /// Encapsulates a command to toggle subscribing to notifications for a site final class ReaderSubscribingNotificationAction { diff --git a/WordPress/Classes/ViewRelated/Reader/Controllers/ReaderSiteSearchViewController.swift b/WordPress/Classes/ViewRelated/Reader/Controllers/ReaderSiteSearchViewController.swift index 67e7c6c78237..e4111780617d 100644 --- a/WordPress/Classes/ViewRelated/Reader/Controllers/ReaderSiteSearchViewController.swift +++ b/WordPress/Classes/ViewRelated/Reader/Controllers/ReaderSiteSearchViewController.swift @@ -3,6 +3,7 @@ import Combine import SwiftUI import WordPressData import WordPressUI +import WordPressKit /// Displays search results from a reader site search. /// diff --git a/WordPress/Classes/ViewRelated/Reader/Detail/ReaderDetailCoordinator.swift b/WordPress/Classes/ViewRelated/Reader/Detail/ReaderDetailCoordinator.swift index e680779c7c6d..b71753e6d5c4 100644 --- a/WordPress/Classes/ViewRelated/Reader/Detail/ReaderDetailCoordinator.swift +++ b/WordPress/Classes/ViewRelated/Reader/Detail/ReaderDetailCoordinator.swift @@ -3,6 +3,7 @@ import WordPressData import WordPressReader import WordPressShared import WordPressUI +import WordPressKit import Combine import WebKit diff --git a/WordPress/Classes/ViewRelated/Reader/Detail/ReaderDetailViewController.swift b/WordPress/Classes/ViewRelated/Reader/Detail/ReaderDetailViewController.swift index 8b21f3d769c2..88a954497299 100644 --- a/WordPress/Classes/ViewRelated/Reader/Detail/ReaderDetailViewController.swift +++ b/WordPress/Classes/ViewRelated/Reader/Detail/ReaderDetailViewController.swift @@ -2,6 +2,8 @@ import UIKit import WordPressUI import AutomatticTracks import WordPressReader +import WordPressData +import WordPressKit @preconcurrency import WebKit typealias RelatedPostsSection = (postType: RemoteReaderSimplePost.PostType, posts: [RemoteReaderSimplePost]) diff --git a/WordPress/Classes/ViewRelated/Reader/Manage/ReaderTagsTableViewModel.swift b/WordPress/Classes/ViewRelated/Reader/Manage/ReaderTagsTableViewModel.swift index 088650ed6eb0..1c195425ed4e 100644 --- a/WordPress/Classes/ViewRelated/Reader/Manage/ReaderTagsTableViewModel.swift +++ b/WordPress/Classes/ViewRelated/Reader/Manage/ReaderTagsTableViewModel.swift @@ -1,6 +1,7 @@ import UIKit import WordPressData import WordPressUI +import WordPressKit class ReaderTagsTableViewModel: NSObject { diff --git a/WordPress/Classes/ViewRelated/Reader/Navigation/ReaderNavigationPath.swift b/WordPress/Classes/ViewRelated/Reader/Navigation/ReaderNavigationPath.swift index ec5b453aea77..61cd57864578 100644 --- a/WordPress/Classes/ViewRelated/Reader/Navigation/ReaderNavigationPath.swift +++ b/WordPress/Classes/ViewRelated/Reader/Navigation/ReaderNavigationPath.swift @@ -1,6 +1,7 @@ import Foundation import WordPressData import WordPressShared +import WordPressKit enum ReaderNavigationPath: Hashable { case recent diff --git a/WordPress/Classes/ViewRelated/Reader/Select Interests/ReaderSelectInterestsViewController.swift b/WordPress/Classes/ViewRelated/Reader/Select Interests/ReaderSelectInterestsViewController.swift index 3cb17282747e..5533bef3ebee 100644 --- a/WordPress/Classes/ViewRelated/Reader/Select Interests/ReaderSelectInterestsViewController.swift +++ b/WordPress/Classes/ViewRelated/Reader/Select Interests/ReaderSelectInterestsViewController.swift @@ -2,6 +2,7 @@ import UIKit import AutomatticTracks import WordPressData import WordPressUI +import WordPressKit protocol ReaderDiscoverFlowDelegate: AnyObject { func didCompleteReaderDiscoverFlow() diff --git a/WordPress/Classes/ViewRelated/Reader/Subscriptions/ReaderSubscriptionHelper.swift b/WordPress/Classes/ViewRelated/Reader/Subscriptions/ReaderSubscriptionHelper.swift index b5f52b9823ce..62fef024e669 100644 --- a/WordPress/Classes/ViewRelated/Reader/Subscriptions/ReaderSubscriptionHelper.swift +++ b/WordPress/Classes/ViewRelated/Reader/Subscriptions/ReaderSubscriptionHelper.swift @@ -1,5 +1,6 @@ import SwiftUI import WordPressData +import WordPressKit struct ReaderSubscriptionHelper { let contextManager: CoreDataStackSwift = ContextManager.shared diff --git a/WordPress/Classes/ViewRelated/Reader/Views/ReaderInterestsCoordinator.swift b/WordPress/Classes/ViewRelated/Reader/Views/ReaderInterestsCoordinator.swift index b1d8b9d795ca..a45301686118 100644 --- a/WordPress/Classes/ViewRelated/Reader/Views/ReaderInterestsCoordinator.swift +++ b/WordPress/Classes/ViewRelated/Reader/Views/ReaderInterestsCoordinator.swift @@ -1,6 +1,7 @@ import Foundation import WordPressData import WordPressShared +import WordPressKit class ReaderSelectInterestsCoordinator { private let interestsService: ReaderFollowedInterestsService diff --git a/WordPress/Classes/ViewRelated/Site Creation/Services/ShoppingCartService.swift b/WordPress/Classes/ViewRelated/Site Creation/Services/ShoppingCartService.swift index e9ac63eb1df3..8cd154f40b7f 100644 --- a/WordPress/Classes/ViewRelated/Site Creation/Services/ShoppingCartService.swift +++ b/WordPress/Classes/ViewRelated/Site Creation/Services/ShoppingCartService.swift @@ -1,5 +1,6 @@ import Foundation import WordPressData +import WordPressKit protocol ShoppingCartServiceProtocol { func makeSiteCreationShoppingCart( diff --git a/WordPress/Classes/ViewRelated/Site Creation/Web Address/WebAddressStep.swift b/WordPress/Classes/ViewRelated/Site Creation/Web Address/WebAddressStep.swift index ce3123b859cf..11efe7e67dab 100644 --- a/WordPress/Classes/ViewRelated/Site Creation/Web Address/WebAddressStep.swift +++ b/WordPress/Classes/ViewRelated/Site Creation/Web Address/WebAddressStep.swift @@ -1,4 +1,5 @@ import UIKit +import WordPressKit /// Site Creation: Domains final class WebAddressStep: WizardStep { diff --git a/WordPress/Classes/ViewRelated/Stats/Insights/StatsLatestPostSummaryInsightsCell.swift b/WordPress/Classes/ViewRelated/Stats/Insights/StatsLatestPostSummaryInsightsCell.swift index d4ca69d5cfa9..cf155ddadb91 100644 --- a/WordPress/Classes/ViewRelated/Stats/Insights/StatsLatestPostSummaryInsightsCell.swift +++ b/WordPress/Classes/ViewRelated/Stats/Insights/StatsLatestPostSummaryInsightsCell.swift @@ -4,6 +4,7 @@ import DesignSystem import AsyncImageKit import WordPressData import WordPressShared +import WordPressKit protocol LatestPostSummaryConfigurable { func configure(withInsightData lastPostInsight: StatsLastPostInsight?, andDelegate delegate: SiteStatsInsightsDelegate?) diff --git a/WordPress/Classes/ViewRelated/Stats/Insights/StatsMostPopularTimeInsightsCell.swift b/WordPress/Classes/ViewRelated/Stats/Insights/StatsMostPopularTimeInsightsCell.swift index 9c792160578b..f144a74de2e6 100644 --- a/WordPress/Classes/ViewRelated/Stats/Insights/StatsMostPopularTimeInsightsCell.swift +++ b/WordPress/Classes/ViewRelated/Stats/Insights/StatsMostPopularTimeInsightsCell.swift @@ -1,5 +1,6 @@ import UIKit import WordPressShared +import WordPressKit class StatsMostPopularTimeInsightsCell: StatsBaseCell { diff --git a/WordPress/Classes/ViewRelated/Stats/StatsHostingViewController.swift b/WordPress/Classes/ViewRelated/Stats/StatsHostingViewController.swift index 56ef8b133cb9..d80f83cc5dee 100644 --- a/WordPress/Classes/ViewRelated/Stats/StatsHostingViewController.swift +++ b/WordPress/Classes/ViewRelated/Stats/StatsHostingViewController.swift @@ -3,6 +3,7 @@ import SwiftUI import JetpackStats import WordPressKit import WordPressShared +import WordPressData import Gravatar import BuildSettingsKit diff --git a/WordPress/WordPress.xcodeproj/project.pbxproj b/WordPress/WordPress.xcodeproj/project.pbxproj index 95994a875704..30db7fe4909a 100644 --- a/WordPress/WordPress.xcodeproj/project.pbxproj +++ b/WordPress/WordPress.xcodeproj/project.pbxproj @@ -5810,6 +5810,7 @@ PROVISIONING_PROFILE = "03b7c1c5-4846-447e-a75c-4005a8e52a68"; PROVISIONING_PROFILE_SPECIFIER = "WordPress Draft Action Development"; SKIP_INSTALL = YES; + SWIFT_OBJC_BRIDGING_HEADER = "WordPressShareExtension/Sources/Bridging-Header.h"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -5852,6 +5853,7 @@ PROVISIONING_PROFILE = "3dd880ae-7e5a-4858-ab4e-6e482e856041"; PROVISIONING_PROFILE_SPECIFIER = "match AppStore org.wordpress.WordPressDraftAction"; SKIP_INSTALL = YES; + SWIFT_OBJC_BRIDGING_HEADER = "WordPressShareExtension/Sources/Bridging-Header.h"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -5894,6 +5896,7 @@ PROVISIONING_PROFILE = "81837878-384c-45d9-909a-8c2c56a2ce58"; PROVISIONING_PROFILE_SPECIFIER = "match InHouse org.wordpress.alpha.WordPressDraftAction"; SKIP_INSTALL = YES; + SWIFT_OBJC_BRIDGING_HEADER = "WordPressShareExtension/Sources/Bridging-Header.h"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -5950,6 +5953,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = "Jetpack iOS Development Share Extension"; SKIP_INSTALL = YES; + SWIFT_OBJC_BRIDGING_HEADER = "WordPressShareExtension/Sources/Bridging-Header.h"; SWIFT_VERSION = 5.0; }; name = Debug; @@ -6001,6 +6005,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.automattic.jetpack.JetpackShare"; SKIP_INSTALL = YES; + SWIFT_OBJC_BRIDGING_HEADER = "WordPressShareExtension/Sources/Bridging-Header.h"; SWIFT_VERSION = 5.0; }; name = Release; @@ -6052,6 +6057,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = "match InHouse com.jetpack.alpha.JetpackShare"; SKIP_INSTALL = YES; + SWIFT_OBJC_BRIDGING_HEADER = "WordPressShareExtension/Sources/Bridging-Header.h"; SWIFT_VERSION = 5.0; }; name = "Release-Alpha"; @@ -6097,6 +6103,7 @@ PROVISIONING_PROFILE_SPECIFIER = "Jetpack iOS Development Draft Action Extensions"; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OBJC_BRIDGING_HEADER = "WordPressShareExtension/Sources/Bridging-Header.h"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -6139,6 +6146,7 @@ PROVISIONING_PROFILE = "3dd880ae-7e5a-4858-ab4e-6e482e856041"; PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.automattic.jetpack.JetpackDraftAction"; SKIP_INSTALL = YES; + SWIFT_OBJC_BRIDGING_HEADER = "WordPressShareExtension/Sources/Bridging-Header.h"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -6181,6 +6189,7 @@ PROVISIONING_PROFILE = "81837878-384c-45d9-909a-8c2c56a2ce58"; PROVISIONING_PROFILE_SPECIFIER = "match InHouse com.jetpack.alpha.JetpackDraftAction"; SKIP_INSTALL = YES; + SWIFT_OBJC_BRIDGING_HEADER = "WordPressShareExtension/Sources/Bridging-Header.h"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -6616,6 +6625,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = "WordPress Share Extension Development"; SKIP_INSTALL = YES; + SWIFT_OBJC_BRIDGING_HEADER = "WordPressShareExtension/Sources/Bridging-Header.h"; SWIFT_VERSION = 5.0; }; name = Debug; @@ -6667,6 +6677,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = "match AppStore org.wordpress.WordPressShare"; SKIP_INSTALL = YES; + SWIFT_OBJC_BRIDGING_HEADER = "WordPressShareExtension/Sources/Bridging-Header.h"; SWIFT_VERSION = 5.0; }; name = Release; @@ -6718,6 +6729,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = "match InHouse org.wordpress.alpha.WordPressShare"; SKIP_INSTALL = YES; + SWIFT_OBJC_BRIDGING_HEADER = "WordPressShareExtension/Sources/Bridging-Header.h"; SWIFT_VERSION = 5.0; }; name = "Release-Alpha"; diff --git a/WordPress/WordPressShareExtension/Sources/Bridging-Header.h b/WordPress/WordPressShareExtension/Sources/Bridging-Header.h new file mode 100644 index 000000000000..d5b202eb3e7b --- /dev/null +++ b/WordPress/WordPressShareExtension/Sources/Bridging-Header.h @@ -0,0 +1 @@ +@import WordPressKitModels; diff --git a/WordPress/WordPressShareExtension/Sources/Services/AppExtensionsService.swift b/WordPress/WordPressShareExtension/Sources/Services/AppExtensionsService.swift index 2af08de98027..1bb9e704f7a0 100644 --- a/WordPress/WordPressShareExtension/Sources/Services/AppExtensionsService.swift +++ b/WordPress/WordPressShareExtension/Sources/Services/AppExtensionsService.swift @@ -4,6 +4,7 @@ import BuildSettingsKit import CocoaLumberjackSwift import CoreData import TracksMini +import WordPressShared import WordPressKit import ShareExtensionCore diff --git a/WordPress/WordPressShareExtension/Sources/Services/CategoryTree.swift b/WordPress/WordPressShareExtension/Sources/Services/CategoryTree.swift index a7e00de7c9e2..732951b899ce 100644 --- a/WordPress/WordPressShareExtension/Sources/Services/CategoryTree.swift +++ b/WordPress/WordPressShareExtension/Sources/Services/CategoryTree.swift @@ -1,4 +1,4 @@ -import WordPressKit.RemotePostCategory +import WordPressKit public class CategoryTree { public var tree: CategoryTreeNode diff --git a/config/Common.xcconfig b/config/Common.xcconfig index e48ba4329508..1fb649c342b0 100644 --- a/config/Common.xcconfig +++ b/config/Common.xcconfig @@ -2,3 +2,8 @@ GCC_WARN_UNUSED_PARAMETER = YES WARNING_CFLAGS = -Wno-nullability-completeness IPHONEOS_DEPLOYMENT_TARGET = 16.0 CODE_SIGN_STYLE = Manual + +// See https://forums.swift.org/t/swift-cant-see-objc-methods-that-include-package-symbols/65732/9 +// Without this flag, Objective-C APIs that contains Swift types in WordPressKit will not be available +// to Swift code in the app target. +OTHER_SWIFT_FLAGS = $(inherited) -Xcc "-fmodule-map-file=${OBJROOT}/GeneratedModuleMaps-${PLATFORM_NAME}/WordPressKit.modulemap" -Xcc "-fmodule-map-file=${OBJROOT}/GeneratedModuleMaps-${PLATFORM_NAME}/WordPressKitModels.modulemap" -Xcc "-fmodule-map-file=${OBJROOT}/GeneratedModuleMaps-${PLATFORM_NAME}/WordPressKitObjC.modulemap" -Xcc "-fmodule-map-file=${OBJROOT}/GeneratedModuleMaps-${PLATFORM_NAME}/WordPressKitObjCUtils.modulemap"