From 7dbf2b9e52016d3de0eb424658b64d8d94274cb2 Mon Sep 17 00:00:00 2001 From: Yusuke Takahashi Date: Mon, 14 Aug 2017 10:02:31 +0900 Subject: [PATCH 1/4] Support swift4 And Update cocoapods --- Classes/Popover.swift | 4 ++-- Example/Popover.xcodeproj/project.pbxproj | 15 ++++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Classes/Popover.swift b/Classes/Popover.swift index 4359f9c..362084c 100644 --- a/Classes/Popover.swift +++ b/Classes/Popover.swift @@ -297,7 +297,7 @@ open class Popover: UIView { UIView.animate(withDuration: self.animationIn / 3, delay: 0, options: .curveLinear, - animations: { _ in + animations: { self.blackOverlay.alpha = 1 }, completion: { _ in }) @@ -308,7 +308,7 @@ open class Popover: UIView { return true } - open func dismiss() { + @objc open func dismiss() { if self.superview != nil { self.willDismissHandler?() UIView.animate(withDuration: self.animationOut, delay: 0, diff --git a/Example/Popover.xcodeproj/project.pbxproj b/Example/Popover.xcodeproj/project.pbxproj index b46edff..a2b2b1d 100644 --- a/Example/Popover.xcodeproj/project.pbxproj +++ b/Example/Popover.xcodeproj/project.pbxproj @@ -196,12 +196,13 @@ TargetAttributes = { 01A491C91E222AFB007E15FA = { CreatedOnToolsVersion = 8.2.1; + LastSwiftMigration = 0900; ProvisioningStyle = Automatic; TestTargetID = 607FACCF1AFB9204008FA782; }; 607FACCF1AFB9204008FA782 = { CreatedOnToolsVersion = 6.3.1; - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; }; }; }; @@ -359,7 +360,8 @@ PRODUCT_BUNDLE_IDENTIFIER = corin8823.PopoverExampleTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PopoverExample.app/PopoverExample"; }; name = Debug; @@ -375,7 +377,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = corin8823.PopoverExampleTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PopoverExample.app/PopoverExample"; }; name = Release; @@ -495,7 +498,8 @@ MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -515,7 +519,8 @@ MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; }; name = Release; }; From 60142184d96ba853adec8e86a272a6c014b6388a Mon Sep 17 00:00:00 2001 From: Yusuke Takahashi Date: Mon, 14 Aug 2017 10:23:10 +0900 Subject: [PATCH 2/4] Fix default for swift3 @objc inference --- Example/Popover.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Example/Popover.xcodeproj/project.pbxproj b/Example/Popover.xcodeproj/project.pbxproj index a2b2b1d..f24ec61 100644 --- a/Example/Popover.xcodeproj/project.pbxproj +++ b/Example/Popover.xcodeproj/project.pbxproj @@ -498,7 +498,7 @@ MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; }; name = Debug; @@ -519,7 +519,7 @@ MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; }; name = Release; From 054df9714ea64e6be2c4485592ab44d783078c35 Mon Sep 17 00:00:00 2001 From: corin8823 Date: Tue, 3 Oct 2017 22:44:50 +0900 Subject: [PATCH 3/4] Update swift version --- .swift-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.swift-version b/.swift-version index f398a20..389f774 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -3.0 \ No newline at end of file +4.0 \ No newline at end of file From 175f0c8b2a2214c1e53dfa9fc665532f2518c9e8 Mon Sep 17 00:00:00 2001 From: corin8823 Date: Tue, 3 Oct 2017 22:55:06 +0900 Subject: [PATCH 4/4] Fix travis --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4be907c..37298a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,11 @@ osx_image: xcode9 language: objective-c install: -- gem install cocoapods -v 1.1.1 --no-document +- gem install cocoapods -v 1.3.1 --no-document before_script: - cd Example - pod install script: -- xcodebuild -workspace Popover.xcworkspace -scheme "PopoverExample" -destination 'platform=iOS Simulator,OS=10.0,name=iPhone 6s' build test | xcpretty \ No newline at end of file +- xcodebuild -workspace Popover.xcworkspace -scheme "PopoverExample" -destination 'platform=iOS Simulator,OS=11.0,name=iPhone 8' build test | xcpretty \ No newline at end of file