From e718cdfed60997a2c1114f90a765c9ba40d63906 Mon Sep 17 00:00:00 2001 From: Masahiro Watanabe Date: Wed, 26 Sep 2018 05:22:27 +0900 Subject: [PATCH 1/7] updated podspec ver to 1.3.0 --- ALRT.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ALRT.podspec b/ALRT.podspec index eb2c17e..55d7b5d 100644 --- a/ALRT.podspec +++ b/ALRT.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "ALRT" - s.version = "1.2.0" + s.version = "1.3.0" s.summary = "ALRT is an easy-to-create UIAlertController framework." s.description = <<-DESC * Easy-to-Create. As easy as 'ALRT.create(.alert).addOK().show()'' From 89f7a9e499e9adb3ee0212fb92c01b96a255eadd Mon Sep 17 00:00:00 2001 From: Masahiro Watanabe Date: Wed, 26 Sep 2018 05:22:47 +0900 Subject: [PATCH 2/7] updated .swift-version to 4.2 --- .swift-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.swift-version b/.swift-version index 5186d07..bf77d54 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -4.0 +4.2 From 894768e067526f46fa2008bf3447de2f69893dd3 Mon Sep 17 00:00:00 2001 From: Masahiro Watanabe Date: Wed, 26 Sep 2018 05:33:02 +0900 Subject: [PATCH 3/7] Updated CFBundleShortVersionString to 1.3.0 --- ALRT/Info.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ALRT/Info.plist b/ALRT/Info.plist index 602d864..9f4a4aa 100644 --- a/ALRT/Info.plist +++ b/ALRT/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.2 + 1.3.0 CFBundleSignature ???? CFBundleVersion From 40480d7440fa8dc452f61499de7062857f03e5f2 Mon Sep 17 00:00:00 2001 From: Masahiro Watanabe Date: Wed, 26 Sep 2018 05:33:32 +0900 Subject: [PATCH 4/7] Set SWIFT_VERSION 4.2 --- ALRT.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ALRT.xcodeproj/project.pbxproj b/ALRT.xcodeproj/project.pbxproj index cbd54ce..0890463 100644 --- a/ALRT.xcodeproj/project.pbxproj +++ b/ALRT.xcodeproj/project.pbxproj @@ -273,7 +273,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -294,7 +294,7 @@ PRODUCT_BUNDLE_IDENTIFIER = org.nsocean.ALRT; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Release; }; From 252d7923a0f4f22837218e7b8cb112d268b3056b Mon Sep 17 00:00:00 2001 From: Masahiro Watanabe Date: Wed, 26 Sep 2018 05:34:15 +0900 Subject: [PATCH 5/7] Updated ALRT to Swift4.2 syntax --- ALRT/ALRT.swift | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/ALRT/ALRT.swift b/ALRT/ALRT.swift index 55b16a1..0d1e3d1 100644 --- a/ALRT/ALRT.swift +++ b/ALRT/ALRT.swift @@ -33,7 +33,7 @@ open class ALRT { fileprivate init(){} - fileprivate init(title: String?, message: String?, preferredStyle: UIAlertControllerStyle) { + fileprivate init(title: String?, message: String?, preferredStyle: UIAlertController.Style) { self.alert = UIAlertController(title: title, message: message, preferredStyle: preferredStyle) @@ -51,9 +51,9 @@ open class ALRT { - returns: ALRT */ - open class func create(_ style: UIAlertControllerStyle, - title: String? = nil, - message: String? = nil) -> ALRT { + open class func create(_ style: UIAlertController.Style, + title: String? = nil, + message: String? = nil) -> ALRT { return ALRT(title: title, message: message, preferredStyle: style) } @@ -85,7 +85,7 @@ open class ALRT { */ @discardableResult - open func addTextField(_ configurationHandler: ((_ textField: UITextField) -> Void)?) -> Self{ + open func addTextField(_ configurationHandler: ((_ textField: UITextField) -> Void)?) -> Self { guard alert?.preferredStyle == .alert else { return self } @@ -115,9 +115,9 @@ open class ALRT { @discardableResult open func addAction(_ title: String?, - style: UIAlertActionStyle = .default, - preferred: Bool = false, - handler: ((_ action: UIAlertAction, _ textFields: [UITextField]?) -> Void)? = nil) -> Self { + style: UIAlertAction.Style = .default, + preferred: Bool = false, + handler: ((_ action: UIAlertAction, _ textFields: [UITextField]?) -> Void)? = nil) -> Self { let action = UIAlertAction(title: title, style: style) { action in handler?(action, self.alert?.preferredStyle == .alert ? self.alert?.textFields : nil) @@ -148,9 +148,9 @@ open class ALRT { @discardableResult open func addOK(_ title: String = "OK", - style: UIAlertActionStyle = .default, - preferred: Bool = false, - handler:((_ action: UIAlertAction, _ textFields: [UITextField]?) -> Void)? = nil) -> Self { + style: UIAlertAction.Style = .default, + preferred: Bool = false, + handler:((_ action: UIAlertAction, _ textFields: [UITextField]?) -> Void)? = nil) -> Self { return addAction(title, style: style, preferred: preferred, handler: handler) } @@ -168,9 +168,9 @@ open class ALRT { @discardableResult open func addCancel(_ title: String = "Cancel", - style: UIAlertActionStyle = .cancel, - preferred: Bool = false, - handler: ((_ action: UIAlertAction, _ textFields: [UITextField]?) -> Void)? = nil) -> Self { + style: UIAlertAction.Style = .cancel, + preferred: Bool = false, + handler: ((_ action: UIAlertAction, _ textFields: [UITextField]?) -> Void)? = nil) -> Self { return addAction(title, style: style, preferred: preferred, handler: handler) } @@ -188,9 +188,9 @@ open class ALRT { @discardableResult open func addDestructive(_ title: String?, - style: UIAlertActionStyle = .destructive, - preferred: Bool = false, - handler: ((_ action: UIAlertAction, _ textFields: [UITextField]?) -> Void)? = nil)-> Self { + style: UIAlertAction.Style = .destructive, + preferred: Bool = false, + handler: ((_ action: UIAlertAction, _ textFields: [UITextField]?) -> Void)? = nil)-> Self { return addAction(title, style: style, preferred: preferred, handler: handler) } @@ -224,8 +224,8 @@ open class ALRT { */ open func show(_ viewControllerToPresent: UIViewController? = nil, - animated: Bool = true, - completion: @escaping ((ALRT.Result) -> Void) = { _ in } ) { + animated: Bool = true, + completion: @escaping ((ALRT.Result) -> Void) = { _ in } ) { guard let alert = self.alert else { completion(.failure(.alertControllerNil)) From 3e83b4822c8f32180967b42e6eac1f59047baa48 Mon Sep 17 00:00:00 2001 From: Masahiro Watanabe Date: Wed, 26 Sep 2018 05:35:00 +0900 Subject: [PATCH 6/7] Xcode -generated files --- Demo/Demo.xcodeproj/project.pbxproj | 20 ++++++++++++++++--- .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++++++++ .../xcshareddata/xcschemes/Demo.xcscheme | 6 +++--- .../xcschemes/DemoUITests.xcscheme | 2 +- 4 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 Demo/Demo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/Demo/Demo.xcodeproj/project.pbxproj b/Demo/Demo.xcodeproj/project.pbxproj index b847811..48ab156 100644 --- a/Demo/Demo.xcodeproj/project.pbxproj +++ b/Demo/Demo.xcodeproj/project.pbxproj @@ -13,7 +13,6 @@ DF17F7E71D4C18DE001DF68B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DF17F7E61D4C18DE001DF68B /* Assets.xcassets */; }; DF17F7EA1D4C18DE001DF68B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DF17F7E81D4C18DE001DF68B /* LaunchScreen.storyboard */; }; DF17F8001D4C228F001DF68B /* ALRT.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF17F7FD1D4C228F001DF68B /* ALRT.swift */; }; - DF17F8011D4C228F001DF68B /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = DF17F7FE1D4C228F001DF68B /* Info.plist */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -108,7 +107,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0820; - LastUpgradeCheck = 0810; + LastUpgradeCheck = 1000; ORGANIZATIONNAME = "Masahiro Watanabe"; TargetAttributes = { DF17F7DB1D4C18DE001DF68B = { @@ -141,7 +140,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - DF17F8011D4C228F001DF68B /* Info.plist in Resources */, DF17F7EA1D4C18DE001DF68B /* LaunchScreen.storyboard in Resources */, DF17F7E71D4C18DE001DF68B /* Assets.xcassets in Resources */, DF17F7E51D4C18DE001DF68B /* Main.storyboard in Resources */, @@ -192,14 +190,22 @@ 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_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; @@ -241,14 +247,22 @@ 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_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/Demo/Demo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Demo/Demo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Demo/Demo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Demo/Demo.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme b/Demo/Demo.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme index 915e5ca..83e2ae0 100644 --- a/Demo/Demo.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme +++ b/Demo/Demo.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme @@ -1,6 +1,6 @@ + codeCoverageEnabled = "YES" + shouldUseLaunchSchemeArgsEnv = "YES"> diff --git a/Demo/Demo.xcodeproj/xcshareddata/xcschemes/DemoUITests.xcscheme b/Demo/Demo.xcodeproj/xcshareddata/xcschemes/DemoUITests.xcscheme index 80f3e40..6843dc3 100644 --- a/Demo/Demo.xcodeproj/xcshareddata/xcschemes/DemoUITests.xcscheme +++ b/Demo/Demo.xcodeproj/xcshareddata/xcschemes/DemoUITests.xcscheme @@ -1,6 +1,6 @@ Date: Wed, 26 Sep 2018 05:37:27 +0900 Subject: [PATCH 7/7] Updated README --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e438e0c..cc03eae 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # ALRT -ALRTは、UIAlertControllerをシンプルに呼び出すことができるライブラリです。 +ALRTは、UIAlertControllerをシンプルに呼び出すことができるライブラリです。 `.alert`, `.actionSheet`のどちらも簡単に作成、表示することができます。 例 @@ -76,8 +76,8 @@ ALRT.create(.alert, title: "Login", message: "Please enter your credentials") ``` ## 環境 -* Xcode 9.3 -* Swift 4.1 +* Xcode 10.0 +* Swift 4.2 * iOS 9.0以上 ## インストール方法 @@ -90,8 +90,8 @@ pod "ALRT" ### Carthage ``` -github "mshrwtnb/ALRT" ~> 1.2.0 +github "mshrwtnb/ALRT" ~> 1.3.0 ``` ## Multilanguages Documents -English version can be found [here](https://github.com/mshrwtnb/ALRT/blob/swift4/README_en.md) +English version can be found [here](https://github.com/mshrwtnb/ALRT/blob/master/README_en.md)