Skip to content

Commit

Permalink
Swift 4.2 migration
Browse files Browse the repository at this point in the history
  • Loading branch information
pmusolino committed Sep 23, 2018
1 parent d7f99a4 commit 6fcc741
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
16 changes: 6 additions & 10 deletions PMSuperButton.xcodeproj/project.pbxproj
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
};
Expand All @@ -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;
};
Expand Down Expand Up @@ -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;
};
Expand All @@ -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;
};
Expand Down
2 changes: 1 addition & 1 deletion PMSuperButtonSample/AppDelegate.swift
Expand Up @@ -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
}
Expand Down
8 changes: 4 additions & 4 deletions Sources/PMSuperButton.swift
Expand Up @@ -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 {
Expand All @@ -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

/**
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 6fcc741

Please sign in to comment.