diff --git a/.swift-version b/.swift-version index 8a36cd1..bf77d54 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -4.1 \ No newline at end of file +4.2 diff --git a/Alertift.podspec b/Alertift.podspec index 7035b20..5c28fa4 100644 --- a/Alertift.podspec +++ b/Alertift.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Alertift" - s.version = "3.2" + s.version = "4.0" s.summary = "UIAlertControlelr wrapper for Swift." s.homepage = "https://github.com/sgr-ksmt/Alertift" # s.screenshots = "" diff --git a/Alertift.xcodeproj/project.pbxproj b/Alertift.xcodeproj/project.pbxproj index 3a2d225..86deb43 100644 --- a/Alertift.xcodeproj/project.pbxproj +++ b/Alertift.xcodeproj/project.pbxproj @@ -122,12 +122,12 @@ 4D13C7641EB064EF007BBB43 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0830; + LastUpgradeCheck = 1000; ORGANIZATIONNAME = "Suguru Kishimoto"; TargetAttributes = { 4D13C76C1EB064EF007BBB43 = { CreatedOnToolsVersion = 8.3.2; - LastSwiftMigration = 0830; + LastSwiftMigration = 1000; ProvisioningStyle = Automatic; }; }; @@ -188,15 +188,23 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -242,15 +250,23 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -295,7 +311,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -314,7 +330,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "-.Alertift"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Release; }; diff --git a/Alertift.xcodeproj/xcshareddata/xcschemes/Alertift.xcscheme b/Alertift.xcodeproj/xcshareddata/xcschemes/Alertift.xcscheme index 6cd1c3d..35bf5f5 100644 --- a/Alertift.xcodeproj/xcshareddata/xcschemes/Alertift.xcscheme +++ b/Alertift.xcodeproj/xcshareddata/xcschemes/Alertift.xcscheme @@ -1,6 +1,6 @@ + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Demo/Demo.xcodeproj/project.pbxproj b/Demo/Demo.xcodeproj/project.pbxproj index f71ab58..21abd78 100644 --- a/Demo/Demo.xcodeproj/project.pbxproj +++ b/Demo/Demo.xcodeproj/project.pbxproj @@ -111,7 +111,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0830; - LastUpgradeCheck = 0830; + LastUpgradeCheck = 1000; ORGANIZATIONNAME = "Suguru Kishimoto"; TargetAttributes = { 4D13C7801EB06535007BBB43 = { @@ -193,15 +193,23 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -243,15 +251,23 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; diff --git a/Sources/Action.swift b/Sources/Action.swift index 9ce4eff..f5cf6b0 100644 --- a/Sources/Action.swift +++ b/Sources/Action.swift @@ -35,7 +35,7 @@ extension Alertift { } /// **UIAlertAction**'s style - private var style: UIAlertActionStyle { + private var style: UIAlertAction.Style { switch self { case .default( _): return .default case .destructive( _): return .destructive diff --git a/Sources/ActionSheet.swift b/Sources/ActionSheet.swift index c8f37d5..e355921 100644 --- a/Sources/ActionSheet.swift +++ b/Sources/ActionSheet.swift @@ -40,7 +40,7 @@ extension Alertift { } /// Add action to alertController - public func action(_ action: Alertift.Action, image: UIImage?, renderingMode: UIImageRenderingMode = .automatic, handler: Handler? = nil) -> Self { + public func action(_ action: Alertift.Action, image: UIImage?, renderingMode: UIImage.RenderingMode = .automatic, handler: Handler? = nil) -> Self { let alertAction = buildAlertAction(action, handler: merge(_alertController.actionHandler, handler ?? { (_, _) in }) ) diff --git a/Sources/Alert.swift b/Sources/Alert.swift index e14485f..b664f03 100644 --- a/Sources/Alert.swift +++ b/Sources/Alert.swift @@ -68,7 +68,7 @@ extension Alertift { /// - renderMode: Render mode for alert action image. Default is `.automatic` /// - handler: The block to execute after this action performed. /// - Returns: Myself - public func action(_ action: Alertift.Action, image: UIImage?, renderingMode: UIImageRenderingMode = .automatic, handler: Handler? = nil) -> Self { + public func action(_ action: Alertift.Action, image: UIImage?, renderingMode: UIImage.RenderingMode = .automatic, handler: Handler? = nil) -> Self { return self.action(action, image: image, renderingMode: renderingMode, isPreferred: false, handler: handler) } @@ -81,7 +81,7 @@ extension Alertift { /// - isPreferred: If you want to change this action to preferredAction, set true. Default is false. /// - handler: The block to execute after this action performed. /// - Returns: Myself - public func action(_ action: Alertift.Action, image: UIImage?, renderingMode: UIImageRenderingMode = .automatic, isPreferred: Bool, handler: Handler? = nil) -> Self { + public func action(_ action: Alertift.Action, image: UIImage?, renderingMode: UIImage.RenderingMode = .automatic, isPreferred: Bool, handler: Handler? = nil) -> Self { let alertAction = buildAlertAction( action, handler: merge(_alertController.actionWithTextFieldsHandler, handler ?? { (_, _, _)in }) diff --git a/Sources/AlertType.swift b/Sources/AlertType.swift index 3d81ab0..8914115 100644 --- a/Sources/AlertType.swift +++ b/Sources/AlertType.swift @@ -17,7 +17,7 @@ internal protocol _AlertType: class { extension _AlertType where Self: AlertType { /// build AlertController - func buildAlertControlelr(title: String? = nil, message: String? = nil, style: UIAlertControllerStyle) { + func buildAlertControlelr(title: String? = nil, message: String? = nil, style: UIAlertController.Style) { _alertController = InnerAlertController(title: title, message: message, preferredStyle: style) _alertController.alertBackgroundColor = type(of: self).backgroundColor _alertController.view.tintColor = type(of: self).buttonTextColor diff --git a/Sources/InnerAlertController.swift b/Sources/InnerAlertController.swift index 3bc41d9..e682fd9 100644 --- a/Sources/InnerAlertController.swift +++ b/Sources/InnerAlertController.swift @@ -159,7 +159,7 @@ class InnerAlertController: UIAlertController { NotificationCenter.default.addObserver( self, selector: #selector(self.textFieldDidChange(_:)), - name: .UITextFieldTextDidChange, object: textField + name: UITextField.textDidChangeNotification, object: textField ) }