Skip to content

Commit 3149852

Browse files
Migrated to Swift 4.2 (using autofix)
1 parent e45f044 commit 3149852

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

Example/LGButton.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@
379379
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
380380
PRODUCT_NAME = "$(TARGET_NAME)";
381381
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
382-
SWIFT_VERSION = 4.0;
382+
SWIFT_VERSION = 4.2;
383383
};
384384
name = Debug;
385385
};
@@ -396,7 +396,7 @@
396396
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
397397
PRODUCT_NAME = "$(TARGET_NAME)";
398398
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
399-
SWIFT_VERSION = 4.0;
399+
SWIFT_VERSION = 4.2;
400400
};
401401
name = Release;
402402
};

Example/LGButton/AppDelegate.swift

+1-1
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+
private func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
1818
// Override point for customization after application launch.
1919
return true
2020
}

Example/Pods/Pods.xcodeproj/project.pbxproj

+14-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LGButton/Classes/LGButton.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ public class LGButton: UIControl {
581581
fileprivate func xibSetup() {
582582
rootView = loadViewFromNib()
583583
rootView.frame = bounds
584-
rootView.autoresizingMask = [UIViewAutoresizing.flexibleWidth, UIViewAutoresizing.flexibleHeight]
584+
rootView.autoresizingMask = [UIView.AutoresizingMask.flexibleWidth, UIView.AutoresizingMask.flexibleHeight]
585585
addSubview(rootView)
586586
leadingLoadingConstraint.isActive = false
587587
trailingLoadingConstraint.isActive = false

LGButton/Classes/SwiftIconFont/SwiftIconFont.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public extension UIImage
6565
let paragraphStyle = NSMutableParagraphStyle()
6666
paragraphStyle.alignment = NSTextAlignment.center
6767

68-
drawText!.draw(in: CGRect(x:0, y:0, width:imageSize.width, height:imageSize.height), withAttributes: [NSAttributedStringKey.font : UIFont.icon(from: font, ofSize: size), NSAttributedStringKey.paragraphStyle: paragraphStyle, NSAttributedStringKey.foregroundColor: iconColor])
68+
drawText!.draw(in: CGRect(x:0, y:0, width:imageSize.width, height:imageSize.height), withAttributes: [NSAttributedString.Key.font : UIFont.icon(from: font, ofSize: size), NSAttributedString.Key.paragraphStyle: paragraphStyle, NSAttributedString.Key.foregroundColor: iconColor])
6969

7070
let image = UIGraphicsGetImageFromCurrentImageContext()
7171
UIGraphicsEndImageContext()
@@ -204,7 +204,7 @@ func getAttributedString(_ text: NSString, ofSize size: CGFloat) -> NSMutableAtt
204204
if let _ = fontArr[fontCode] {
205205
attributedString.replaceCharacters(in: substringRange, with: String.getIcon(from: fontType, code: fontCode)!)
206206
let newRange = NSRange(location: substringRange.location, length: 1)
207-
attributedString.addAttribute(NSAttributedStringKey.font, value: UIFont.icon(from: fontType, ofSize: size), range: newRange)
207+
attributedString.addAttribute(NSAttributedString.Key.font, value: UIFont.icon(from: fontType, ofSize: size), range: newRange)
208208
}
209209
}
210210

@@ -225,7 +225,7 @@ func GetIconIndexWithSelectedIcon(_ icon: String) -> String {
225225
var fontCode: String = splitArr[1]
226226

227227
if fontCode.lowercased().range(of: "_") != nil {
228-
fontCode = (fontCode as NSString!).replacingOccurrences(of: "_", with: "-")
228+
fontCode = (fontCode as NSString).replacingOccurrences(of: "_", with: "-")
229229
}
230230
iconIndex = fontCode
231231
}

0 commit comments

Comments
 (0)