Skip to content

Commit 6fcc741

Browse files
committed
Swift 4.2 migration
1 parent d7f99a4 commit 6fcc741

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

PMSuperButton.xcodeproj/project.pbxproj

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,12 @@
233233
TargetAttributes = {
234234
454FFF5F1EF1927A00F1C34C = {
235235
CreatedOnToolsVersion = 8.3.2;
236-
LastSwiftMigration = 0900;
236+
LastSwiftMigration = 1000;
237237
ProvisioningStyle = Automatic;
238238
};
239239
52D6D97B1BEFF229002C0205 = {
240240
CreatedOnToolsVersion = 7.1;
241-
LastSwiftMigration = 0900;
241+
LastSwiftMigration = 1000;
242242
};
243243
52D6D9851BEFF229002C0205 = {
244244
CreatedOnToolsVersion = 7.1;
@@ -367,8 +367,7 @@
367367
PRODUCT_BUNDLE_IDENTIFIER = com.codeido.PMSuperButtonSample;
368368
PRODUCT_NAME = "$(TARGET_NAME)";
369369
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
370-
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
371-
SWIFT_VERSION = 4.0;
370+
SWIFT_VERSION = 4.2;
372371
};
373372
name = Debug;
374373
};
@@ -385,8 +384,7 @@
385384
PRODUCT_BUNDLE_IDENTIFIER = com.codeido.PMSuperButtonSample;
386385
PRODUCT_NAME = "$(TARGET_NAME)";
387386
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
388-
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
389-
SWIFT_VERSION = 4.0;
387+
SWIFT_VERSION = 4.2;
390388
};
391389
name = Release;
392390
};
@@ -522,8 +520,7 @@
522520
PRODUCT_NAME = PMSuperButton;
523521
SKIP_INSTALL = YES;
524522
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
525-
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
526-
SWIFT_VERSION = 4.0;
523+
SWIFT_VERSION = 4.2;
527524
};
528525
name = Debug;
529526
};
@@ -545,8 +542,7 @@
545542
PRODUCT_NAME = PMSuperButton;
546543
SKIP_INSTALL = YES;
547544
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
548-
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
549-
SWIFT_VERSION = 4.0;
545+
SWIFT_VERSION = 4.2;
550546
};
551547
name = Release;
552548
};

PMSuperButtonSample/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1414
var window: UIWindow?
1515

1616

17-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
17+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
1818
// Override point for customization after application launch.
1919
return true
2020
}

Sources/PMSuperButton.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@ open class PMSuperButton: UIButton {
163163

164164
//MARK: - Image
165165
///Image UIButton content mode
166-
@IBInspectable open var imageViewContentMode: Int = UIViewContentMode.scaleToFill.rawValue{
166+
@IBInspectable open var imageViewContentMode: Int = UIView.ContentMode.scaleToFill.rawValue{
167167
didSet{
168-
imageView?.contentMode = UIViewContentMode(rawValue: imageViewContentMode) ?? .scaleToFill
168+
imageView?.contentMode = UIView.ContentMode(rawValue: imageViewContentMode) ?? .scaleToFill
169169
}
170170
}
171171
@IBInspectable open var imageAlpha: CGFloat = 1.0 {
@@ -188,7 +188,7 @@ open class PMSuperButton: UIButton {
188188
}
189189

190190
//MARK: - Loading
191-
let indicator: UIActivityIndicatorView = UIActivityIndicatorView(activityIndicatorStyle: UIActivityIndicatorViewStyle.gray)
191+
let indicator: UIActivityIndicatorView = UIActivityIndicatorView(style: UIActivityIndicatorView.Style.gray)
192192
public var isLoading: Bool = false
193193

194194
/**
@@ -271,7 +271,7 @@ extension PMSuperButton: CAAnimationDelegate{
271271

272272
// Set animation to be consistent on completion
273273
animation.isRemovedOnCompletion = false
274-
animation.fillMode = kCAFillModeForwards
274+
animation.fillMode = CAMediaTimingFillMode.forwards
275275

276276
// Add animation to the view's layer
277277
let fade = CAKeyframeAnimation(keyPath: "opacity")

0 commit comments

Comments
 (0)