From bfe175f73dca32b5019d13571ef982d621c8ea2b Mon Sep 17 00:00:00 2001 From: Raghav Ahuja Date: Wed, 19 Feb 2020 01:30:35 +0530 Subject: [PATCH 1/2] Updated Readme and demo project file --- .../contents.xcworkspacedata | 10 ------ .../xcshareddata/IDEWorkspaceChecks.plist | 8 ----- .../xcshareddata/WorkspaceSettings.xcsettings | 8 ----- .../project.pbxproj | 34 ++++++++----------- .../AddUserViewController.swift | 2 +- README.md | 6 ++-- 6 files changed, 19 insertions(+), 49 deletions(-) delete mode 100644 PublisherKit.xcworkspace/contents.xcworkspacedata delete mode 100644 PublisherKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 PublisherKit.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/PublisherKit.xcworkspace/contents.xcworkspacedata b/PublisherKit.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index bde182b..0000000 --- a/PublisherKit.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/PublisherKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/PublisherKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/PublisherKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/PublisherKit.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/PublisherKit.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index a72dc2b..0000000 --- a/PublisherKit.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded - - - \ No newline at end of file diff --git a/PublisherKitDemo/PublisherKitDemo.xcodeproj/project.pbxproj b/PublisherKitDemo/PublisherKitDemo.xcodeproj/project.pbxproj index 47c2a02..7493907 100644 --- a/PublisherKitDemo/PublisherKitDemo.xcodeproj/project.pbxproj +++ b/PublisherKitDemo/PublisherKitDemo.xcodeproj/project.pbxproj @@ -3,10 +3,11 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 52; objects = { /* Begin PBXBuildFile section */ + AD5506D123FC793300B87284 /* PublisherKit in Frameworks */ = {isa = PBXBuildFile; productRef = AD5506D023FC793300B87284 /* PublisherKit */; }; AD9ADA6723DC338D00B2965A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD9ADA6623DC338D00B2965A /* AppDelegate.swift */; }; AD9ADA6923DC338D00B2965A /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD9ADA6823DC338D00B2965A /* SceneDelegate.swift */; }; AD9ADA7023DC338F00B2965A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AD9ADA6F23DC338F00B2965A /* Assets.xcassets */; }; @@ -18,8 +19,6 @@ AD9ADA9423DC33BC00B2965A /* AddUserViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD9ADA8F23DC33BC00B2965A /* AddUserViewController.swift */; }; AD9ADA9823DC33D400B2965A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AD9ADA9623DC33D300B2965A /* LaunchScreen.storyboard */; }; AD9ADA9923DC33D400B2965A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AD9ADA9723DC33D300B2965A /* Main.storyboard */; }; - AD9ADA9C23DC33F000B2965A /* PublisherKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD9ADA9B23DC33F000B2965A /* PublisherKit.framework */; }; - AD9ADA9D23DC33F000B2965A /* PublisherKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = AD9ADA9B23DC33F000B2965A /* PublisherKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -32,21 +31,8 @@ }; /* End PBXContainerItemProxy section */ -/* Begin PBXCopyFilesBuildPhase section */ - AD9ADA9E23DC33F000B2965A /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - AD9ADA9D23DC33F000B2965A /* PublisherKit.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - /* Begin PBXFileReference section */ + AD5506CF23FC792900B87284 /* PublisherKit */ = {isa = PBXFileReference; lastKnownFileType = folder; name = PublisherKit; path = ..; sourceTree = ""; }; AD9ADA6323DC338D00B2965A /* PublisherKitDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PublisherKitDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; AD9ADA6623DC338D00B2965A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; AD9ADA6823DC338D00B2965A /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; @@ -70,7 +56,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - AD9ADA9C23DC33F000B2965A /* PublisherKit.framework in Frameworks */, + AD5506D123FC793300B87284 /* PublisherKit in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -87,6 +73,7 @@ AD9ADA5A23DC338D00B2965A = { isa = PBXGroup; children = ( + AD5506CF23FC792900B87284 /* PublisherKit */, AD9ADA6523DC338D00B2965A /* PublisherKitDemo */, AD9ADA7C23DC338F00B2965A /* PublisherKitDemoTests */, AD9ADA6423DC338D00B2965A /* Products */, @@ -172,13 +159,15 @@ AD9ADA5F23DC338D00B2965A /* Sources */, AD9ADA6023DC338D00B2965A /* Frameworks */, AD9ADA6123DC338D00B2965A /* Resources */, - AD9ADA9E23DC33F000B2965A /* Embed Frameworks */, ); buildRules = ( ); dependencies = ( ); name = PublisherKitDemo; + packageProductDependencies = ( + AD5506D023FC793300B87284 /* PublisherKit */, + ); productName = PublisherKitDemo; productReference = AD9ADA6323DC338D00B2965A /* PublisherKitDemo.app */; productType = "com.apple.product-type.application"; @@ -514,6 +503,13 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCSwiftPackageProductDependency section */ + AD5506D023FC793300B87284 /* PublisherKit */ = { + isa = XCSwiftPackageProductDependency; + productName = PublisherKit; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = AD9ADA5B23DC338D00B2965A /* Project object */; } diff --git a/PublisherKitDemo/PublisherKitDemo/View Controllers/AddUserViewController.swift b/PublisherKitDemo/PublisherKitDemo/View Controllers/AddUserViewController.swift index 8d38d16..7378921 100644 --- a/PublisherKitDemo/PublisherKitDemo/View Controllers/AddUserViewController.swift +++ b/PublisherKitDemo/PublisherKitDemo/View Controllers/AddUserViewController.swift @@ -58,7 +58,7 @@ final class AddUserViewController: UIViewController { } private func getPublisher(for textField: UITextField, saveIn method: @escaping (String) -> Void) -> AnyPublisher { - textField.textChangePublisher + textField.textDidChangePublisher .receive(on: DispatchQueue.global(qos: .userInitiated)) .handleEvents(receiveOutput: method) // update value for field in view model .eraseToAnyPublisher() diff --git a/README.md b/README.md index 3aa1516..a0d7bb9 100644 --- a/README.md +++ b/README.md @@ -65,13 +65,13 @@ You can install by using swift package manager built into Xcode or clone the rep ## Usage ```swift -searchTextField.textChangePublisher - .debounce(for: .milliseconds(300), on: DispatchQueue.global(qos: .userInitiated)) +searchTextField.textDidChangePublisher + .debounce(for: .milliseconds(300), scheduler: DispatchQueue.main) .compactMap { (text) -> String? in text.isEmpty ? nil : text } .removeDuplicates() - .flatMap { (text) in + .flatMap { (text) -> AnyPublisher<[SearchResults], Never> in self.search(with: text) } .receive(on: DispatchQueue.main) From c4eedddf53dadb2ac059f455e2c2ff07ce779b80 Mon Sep 17 00:00:00 2001 From: Raghav Ahuja Date: Wed, 19 Feb 2020 01:33:06 +0530 Subject: [PATCH 2/2] Minor change in readme file --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a0d7bb9..78af88f 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ searchTextField.textDidChangePublisher text.isEmpty ? nil : text } .removeDuplicates() - .flatMap { (text) -> AnyPublisher<[SearchResults], Never> in + .flatMap { (text) -> AnyPublisher in self.search(with: text) } .receive(on: DispatchQueue.main)