diff --git a/.swift-version b/.swift-version index 9f55b2c..bf77d54 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -3.0 +4.2 diff --git a/Example/EPSignature.xcodeproj/project.pbxproj b/Example/EPSignature.xcodeproj/project.pbxproj index 56fba5a..5a8816a 100644 --- a/Example/EPSignature.xcodeproj/project.pbxproj +++ b/Example/EPSignature.xcodeproj/project.pbxproj @@ -210,12 +210,12 @@ 607FACCF1AFB9204008FA782 = { CreatedOnToolsVersion = 6.3.1; DevelopmentTeam = DG779MAMM2; - LastSwiftMigration = 0900; + LastSwiftMigration = 1000; }; 607FACE41AFB9204008FA782 = { CreatedOnToolsVersion = 6.3.1; DevelopmentTeam = DG779MAMM2; - LastSwiftMigration = 0900; + LastSwiftMigration = 1000; TestTargetID = 607FACCF1AFB9204008FA782; }; }; @@ -523,7 +523,7 @@ MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -540,7 +540,7 @@ MODULE_NAME = ExampleApp; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -560,7 +560,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EPSignature_Example.app/EPSignature_Example"; }; name = Debug; @@ -576,7 +576,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/EPSignature_Example.app/EPSignature_Example"; }; name = Release; diff --git a/Example/EPSignature/AppDelegate.swift b/Example/EPSignature/AppDelegate.swift index 3f1cbb9..cce0004 100644 --- a/Example/EPSignature/AppDelegate.swift +++ b/Example/EPSignature/AppDelegate.swift @@ -13,7 +13,7 @@ import UIKit class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { // Application launch state return true } diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj index dd9e263..cd77b00 100644 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -324,7 +324,7 @@ LastUpgradeCheck = 0700; TargetAttributes = { 19D6D9705482D1B9CB1C3F1D8CC28599 = { - LastSwiftMigration = 0900; + LastSwiftMigration = 1000; }; }; }; @@ -428,7 +428,7 @@ SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -710,7 +710,7 @@ SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; diff --git a/Pod/Classes/EPExtensions.swift b/Pod/Classes/EPExtensions.swift index 17a3610..6b04fb8 100644 --- a/Pod/Classes/EPExtensions.swift +++ b/Pod/Classes/EPExtensions.swift @@ -17,10 +17,10 @@ extension UIViewController { } func showAlert(_ message: String, andTitle title: String) { - let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.alert) + let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertController.Style.alert) // add an action (button) - alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil)) + alert.addAction(UIAlertAction(title: "OK", style: UIAlertAction.Style.default, handler: nil)) // show the alert self.present(alert, animated: true, completion: nil) diff --git a/Pod/Classes/EPSignatureViewController.swift b/Pod/Classes/EPSignatureViewController.swift index 249d3b8..6ff07fb 100644 --- a/Pod/Classes/EPSignatureViewController.swift +++ b/Pod/Classes/EPSignatureViewController.swift @@ -39,13 +39,13 @@ open class EPSignatureViewController: UIViewController { override open func viewDidLoad() { super.viewDidLoad() - let cancelButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.cancel, target: self, action: #selector(EPSignatureViewController.onTouchCancelButton)) + let cancelButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.cancel, target: self, action: #selector(EPSignatureViewController.onTouchCancelButton)) cancelButton.tintColor = tintColor self.navigationItem.leftBarButtonItem = cancelButton - let doneButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.done, target: self, action: #selector(EPSignatureViewController.onTouchDoneButton)) + let doneButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.done, target: self, action: #selector(EPSignatureViewController.onTouchDoneButton)) doneButton.tintColor = tintColor - let clearButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.trash, target: self, action: #selector(EPSignatureViewController.onTouchClearButton)) + let clearButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.trash, target: self, action: #selector(EPSignatureViewController.onTouchClearButton)) clearButton.tintColor = tintColor if showsDate { @@ -58,7 +58,7 @@ open class EPSignatureViewController: UIViewController { } if showsSaveSignatureOption { - let actionButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.action, target: self, action: #selector(EPSignatureViewController.onTouchActionButton(_:))) + let actionButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.action, target: self, action: #selector(EPSignatureViewController.onTouchActionButton(_:))) actionButton.tintColor = tintColor self.navigationItem.rightBarButtonItems = [doneButton, clearButton, actionButton] switchSaveSignature.onTintColor = tintColor @@ -121,20 +121,20 @@ open class EPSignatureViewController: UIViewController { } @objc func onTouchActionButton(_ barButton: UIBarButtonItem) { - let action = UIAlertController(title: "Action", message: "", preferredStyle: UIAlertControllerStyle.actionSheet) + let action = UIAlertController(title: "Action", message: "", preferredStyle: UIAlertController.Style.actionSheet) action.view.tintColor = tintColor - action.addAction(UIAlertAction(title: "Load default signature", style: UIAlertActionStyle.default, handler: { action in + action.addAction(UIAlertAction(title: "Load default signature", style: UIAlertAction.Style.default, handler: { action in let docPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first let filePath = (docPath! as NSString).appendingPathComponent("sig.data") self.signatureView.loadSignature(filePath) })) - action.addAction(UIAlertAction(title: "Delete default signature", style: UIAlertActionStyle.destructive, handler: { action in + action.addAction(UIAlertAction(title: "Delete default signature", style: UIAlertAction.Style.destructive, handler: { action in self.signatureView.removeSignature() })) - action.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.cancel, handler: nil)) + action.addAction(UIAlertAction(title: "Cancel", style: UIAlertAction.Style.cancel, handler: nil)) if let popOver = action.popoverPresentationController { popOver.barButtonItem = barButton