From 58e4aa5ad606c0ced2e50b3b9c9708bb4507f01d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8A=89=E9=9B=A8=E8=BE=B0?= Date: Thu, 10 Jan 2019 16:11:01 +0900 Subject: [PATCH 1/3] update. swift4.2 syntax --- .../Pods/Pods.xcodeproj/project.pbxproj | 6 +++--- .../project.pbxproj | 18 +++++++++--------- .../SmileLock-Example/AppDelegate.swift | 2 +- SmileLock/Classes/PasswordContainerView.swift | 4 ++-- SmileLock/Classes/PasswordDotView.swift | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/SmileLock-Example/Pods/Pods.xcodeproj/project.pbxproj b/SmileLock-Example/Pods/Pods.xcodeproj/project.pbxproj index 3614495..5e8dd5d 100644 --- a/SmileLock-Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/SmileLock-Example/Pods/Pods.xcodeproj/project.pbxproj @@ -298,7 +298,7 @@ LastSwiftMigration = 0800; }; ADDCF128C9FD122E6F900A0175BCC718 = { - LastSwiftMigration = 0800; + LastSwiftMigration = 1010; }; }; }; @@ -433,7 +433,7 @@ SDKROOT = iphoneos; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -500,7 +500,7 @@ PRODUCT_NAME = SmileLock; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; diff --git a/SmileLock-Example/SmileLock-Example.xcodeproj/project.pbxproj b/SmileLock-Example/SmileLock-Example.xcodeproj/project.pbxproj index a8aa8fb..8eda7c7 100644 --- a/SmileLock-Example/SmileLock-Example.xcodeproj/project.pbxproj +++ b/SmileLock-Example/SmileLock-Example.xcodeproj/project.pbxproj @@ -236,16 +236,16 @@ TargetAttributes = { B7E3A1A91CCC6448005F680E = { CreatedOnToolsVersion = 7.3; - LastSwiftMigration = 0800; + LastSwiftMigration = 1010; }; B7E3A1BD1CCC6449005F680E = { CreatedOnToolsVersion = 7.3; - LastSwiftMigration = 0800; + LastSwiftMigration = 1010; TestTargetID = B7E3A1A91CCC6448005F680E; }; B7E3A1C81CCC6449005F680E = { CreatedOnToolsVersion = 7.3; - LastSwiftMigration = 0800; + LastSwiftMigration = 1010; TestTargetID = B7E3A1A91CCC6448005F680E; }; }; @@ -507,7 +507,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "edu.self.SmileLock-Example"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -522,7 +522,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "edu.self.SmileLock-Example"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Release; }; @@ -534,7 +534,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "edu.self.SmileLock-ExampleTests"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SmileLock-Example.app/SmileLock-Example"; }; name = Debug; @@ -547,7 +547,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "edu.self.SmileLock-ExampleTests"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SmileLock-Example.app/SmileLock-Example"; }; name = Release; @@ -559,7 +559,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "edu.self.SmileLock-ExampleUITests"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TEST_TARGET_NAME = "SmileLock-Example"; }; name = Debug; @@ -571,7 +571,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "edu.self.SmileLock-ExampleUITests"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TEST_TARGET_NAME = "SmileLock-Example"; }; name = Release; diff --git a/SmileLock-Example/SmileLock-Example/AppDelegate.swift b/SmileLock-Example/SmileLock-Example/AppDelegate.swift index 96abc9d..974ce3b 100644 --- a/SmileLock-Example/SmileLock-Example/AppDelegate.swift +++ b/SmileLock-Example/SmileLock-Example/AppDelegate.swift @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } diff --git a/SmileLock/Classes/PasswordContainerView.swift b/SmileLock/Classes/PasswordContainerView.swift index 68e8dfe..30af6cd 100644 --- a/SmileLock/Classes/PasswordContainerView.swift +++ b/SmileLock/Classes/PasswordContainerView.swift @@ -52,7 +52,7 @@ open class PasswordContainerView: UIView { open override var tintColor: UIColor! { didSet { guard !isVibrancyEffect else { return } - deleteButton.setTitleColor(tintColor, for: UIControlState()) + deleteButton.setTitleColor(tintColor, for: .normal) passwordDotView.strokeColor = tintColor touchAuthenticationButton.tintColor = tintColor passwordInputViews.forEach { @@ -151,7 +151,7 @@ open class PasswordContainerView: UIView { } } - touchAuthenticationButton.setImage(image, for: UIControlState()) + touchAuthenticationButton.setImage(image, for: .normal) touchAuthenticationButton.tintColor = tintColor } diff --git a/SmileLock/Classes/PasswordDotView.swift b/SmileLock/Classes/PasswordDotView.swift index 6a4b58b..ba4e3d0 100644 --- a/SmileLock/Classes/PasswordDotView.swift +++ b/SmileLock/Classes/PasswordDotView.swift @@ -123,7 +123,7 @@ open class PasswordDotView: UIView { private extension PasswordDotView { //MARK: Animation func shakeAnimation(withDuration duration: TimeInterval, animations: @escaping () -> (), completion: @escaping () -> ()) { - UIView.animate(withDuration: duration, delay: 0, usingSpringWithDamping: 0.01, initialSpringVelocity: 0.35, options: UIViewAnimationOptions(), animations: { + UIView.animate(withDuration: duration, delay: 0, usingSpringWithDamping: 0.01, initialSpringVelocity: 0.35, options: .curveEaseInOut, animations: { animations() }) { _ in completion() From 009bd9167ffc4dde421047808e0d61910972f00a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8A=89=E9=9B=A8=E8=BE=B0?= Date: Thu, 10 Jan 2019 16:17:35 +0900 Subject: [PATCH 2/3] Bump version to 3.0.6 --- .swift-version | 1 - SmileLock.podspec | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 .swift-version diff --git a/.swift-version b/.swift-version deleted file mode 100644 index 389f774..0000000 --- a/.swift-version +++ /dev/null @@ -1 +0,0 @@ -4.0 \ No newline at end of file diff --git a/SmileLock.podspec b/SmileLock.podspec index 632f7e2..2f6585d 100644 --- a/SmileLock.podspec +++ b/SmileLock.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "SmileLock" - s.version = "3.0.5" + s.version = "3.0.6" s.summary = "A library for make a beautiful Passcode Lock View." s.description = <<-DESC 1. Create a beautiful passcode lock view simply. @@ -16,6 +16,7 @@ Pod::Spec.new do |s| s.author = { 'Rain' => 'liu044100@gmail.com' } + s.swift_version = "4.2" s.platform = :ios, '9.0' s.requires_arc = true s.source = { :git => "https://github.com/recruit-lifestyle/Smile-Lock.git", :tag => s.version.to_s} From c417b1b8e5a6cd59fd6a6cc1474837ac99deb9f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8A=89=E9=9B=A8=E8=BE=B0?= Date: Thu, 10 Jan 2019 16:22:26 +0900 Subject: [PATCH 3/3] mod. follow Xcode recommended settings --- .../project.pbxproj | 18 +++++++++++++++++- SmileLock/Classes/PasswordInputView.swift | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/SmileLock-Example/SmileLock-Example.xcodeproj/project.pbxproj b/SmileLock-Example/SmileLock-Example.xcodeproj/project.pbxproj index 8eda7c7..21d41cf 100644 --- a/SmileLock-Example/SmileLock-Example.xcodeproj/project.pbxproj +++ b/SmileLock-Example/SmileLock-Example.xcodeproj/project.pbxproj @@ -231,7 +231,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 1010; ORGANIZATIONNAME = rain; TargetAttributes = { B7E3A1A91CCC6448005F680E = { @@ -414,14 +414,22 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -463,14 +471,22 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; diff --git a/SmileLock/Classes/PasswordInputView.swift b/SmileLock/Classes/PasswordInputView.swift index d64026f..8a5374b 100644 --- a/SmileLock/Classes/PasswordInputView.swift +++ b/SmileLock/Classes/PasswordInputView.swift @@ -19,7 +19,7 @@ open class PasswordInputView: UIView { let circleView = UIView() let button = UIButton() - open let label = UILabel() + public let label = UILabel() open var labelFont: UIFont? fileprivate let fontSizeRatio: CGFloat = 46 / 40 fileprivate let borderWidthRatio: CGFloat = 1 / 26