diff --git a/PMSuperButton.xcodeproj/project.pbxproj b/PMSuperButton.xcodeproj/project.pbxproj index f4716c3..0f08ef4 100644 --- a/PMSuperButton.xcodeproj/project.pbxproj +++ b/PMSuperButton.xcodeproj/project.pbxproj @@ -233,12 +233,12 @@ TargetAttributes = { 454FFF5F1EF1927A00F1C34C = { CreatedOnToolsVersion = 8.3.2; - LastSwiftMigration = 0900; + LastSwiftMigration = 1000; ProvisioningStyle = Automatic; }; 52D6D97B1BEFF229002C0205 = { CreatedOnToolsVersion = 7.1; - LastSwiftMigration = 0900; + LastSwiftMigration = 1000; }; 52D6D9851BEFF229002C0205 = { CreatedOnToolsVersion = 7.1; @@ -367,8 +367,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.codeido.PMSuperButtonSample; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -385,8 +384,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.codeido.PMSuperButtonSample; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Release; }; @@ -522,8 +520,7 @@ PRODUCT_NAME = PMSuperButton; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -545,8 +542,7 @@ PRODUCT_NAME = PMSuperButton; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Release; }; diff --git a/PMSuperButtonSample/AppDelegate.swift b/PMSuperButtonSample/AppDelegate.swift index 865566b..ea12c77 100644 --- a/PMSuperButtonSample/AppDelegate.swift +++ b/PMSuperButtonSample/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/Sources/PMSuperButton.swift b/Sources/PMSuperButton.swift index c0756e1..b4371cb 100644 --- a/Sources/PMSuperButton.swift +++ b/Sources/PMSuperButton.swift @@ -163,9 +163,9 @@ open class PMSuperButton: UIButton { //MARK: - Image ///Image UIButton content mode - @IBInspectable open var imageViewContentMode: Int = UIViewContentMode.scaleToFill.rawValue{ + @IBInspectable open var imageViewContentMode: Int = UIView.ContentMode.scaleToFill.rawValue{ didSet{ - imageView?.contentMode = UIViewContentMode(rawValue: imageViewContentMode) ?? .scaleToFill + imageView?.contentMode = UIView.ContentMode(rawValue: imageViewContentMode) ?? .scaleToFill } } @IBInspectable open var imageAlpha: CGFloat = 1.0 { @@ -188,7 +188,7 @@ open class PMSuperButton: UIButton { } //MARK: - Loading - let indicator: UIActivityIndicatorView = UIActivityIndicatorView(activityIndicatorStyle: UIActivityIndicatorViewStyle.gray) + let indicator: UIActivityIndicatorView = UIActivityIndicatorView(style: UIActivityIndicatorView.Style.gray) public var isLoading: Bool = false /** @@ -271,7 +271,7 @@ extension PMSuperButton: CAAnimationDelegate{ // Set animation to be consistent on completion animation.isRemovedOnCompletion = false - animation.fillMode = kCAFillModeForwards + animation.fillMode = CAMediaTimingFillMode.forwards // Add animation to the view's layer let fade = CAKeyframeAnimation(keyPath: "opacity")