Skip to content

Commit

Permalink
Merge pull request #28 from 1amageek/develop
Browse files Browse the repository at this point in the history
Migrate to swift 4.2
  • Loading branch information
sgr-ksmt authored Sep 26, 2018
2 parents 53bc3e2 + 12f94a9 commit ddbdca8
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1
4.2
2 changes: 1 addition & 1 deletion Alertift.podspec
Original file line number Diff line number Diff line change
@@ -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 = ""
Expand Down
24 changes: 20 additions & 4 deletions Alertift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
};
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
};
Expand All @@ -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;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
LastUpgradeVersion = "1000"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
18 changes: 17 additions & 1 deletion Demo/Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0830;
LastUpgradeCheck = 0830;
LastUpgradeCheck = 1000;
ORGANIZATIONNAME = "Suguru Kishimoto";
TargetAttributes = {
4D13C7801EB06535007BBB43 = {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Sources/Action.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Sources/ActionSheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
)
Expand Down
4 changes: 2 additions & 2 deletions Sources/Alert.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -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 })
Expand Down
2 changes: 1 addition & 1 deletion Sources/AlertType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Sources/InnerAlertController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class InnerAlertController: UIAlertController {
NotificationCenter.default.addObserver(
self,
selector: #selector(self.textFieldDidChange(_:)),
name: .UITextFieldTextDidChange, object: textField
name: UITextField.textDidChangeNotification, object: textField
)
}

Expand Down

0 comments on commit ddbdca8

Please sign in to comment.