From fc835c84f1ae758b569b87d0d6c73fa44de2b40d Mon Sep 17 00:00:00 2001 From: Dionysios Bitros Date: Mon, 3 Jun 2019 15:32:00 +1200 Subject: [PATCH 1/8] * Upgraded to Swift 5 and Xcode 10.2 project settings --- .../project.pbxproj | 26 +++++++++++-- MIAlertControllerDemo/AppDelegate.swift | 4 +- .../MIAlertController/MIAlertController.swift | 18 ++++----- Pods/Pods.xcodeproj/project.pbxproj | 38 +++++++++++++++++-- 4 files changed, 66 insertions(+), 20 deletions(-) diff --git a/MIAlertControllerDemo.xcodeproj/project.pbxproj b/MIAlertControllerDemo.xcodeproj/project.pbxproj index db3589c..b46fab5 100755 --- a/MIAlertControllerDemo.xcodeproj/project.pbxproj +++ b/MIAlertControllerDemo.xcodeproj/project.pbxproj @@ -118,7 +118,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = "Mario Iannotta"; TargetAttributes = { ACAE3BEE1D33C9260034530E = { @@ -129,7 +129,7 @@ }; buildConfigurationList = ACAE3BEA1D33C9260034530E /* Build configuration list for PBXProject "MIAlertControllerDemo" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -242,19 +242,28 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 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; @@ -290,19 +299,28 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 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; @@ -339,7 +357,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.marioiannotta.MIAlertControllerDemo; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -354,7 +372,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.marioiannotta.MIAlertControllerDemo; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/MIAlertControllerDemo/AppDelegate.swift b/MIAlertControllerDemo/AppDelegate.swift index b309534..03dcfd3 100755 --- a/MIAlertControllerDemo/AppDelegate.swift +++ b/MIAlertControllerDemo/AppDelegate.swift @@ -13,9 +13,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { return true } diff --git a/Pods/MIAlertController/MIAlertController/MIAlertController.swift b/Pods/MIAlertController/MIAlertController/MIAlertController.swift index 40013e6..8542ecc 100755 --- a/Pods/MIAlertController/MIAlertController/MIAlertController.swift +++ b/Pods/MIAlertController/MIAlertController/MIAlertController.swift @@ -33,7 +33,7 @@ open class MIAlertController: UIViewController { public var titleLabelTextAlignment = NSTextAlignment.center // Message - public var messageLabelFont = UIFont.systemFont(ofSize: 16, weight: UIFontWeightLight) + public var messageLabelFont = UIFont.systemFont(ofSize: 16, weight: UIFont.Weight.light) public var messageLabelTextColor = UIColor.black public var messageLabelTextAlignment = NSTextAlignment.center public var messageVerticalSpaceFromTitle: CGFloat = 10 @@ -54,7 +54,7 @@ open class MIAlertController: UIViewController { public var font = UIFont.boldSystemFont(ofSize: 15) public var textColor = UIColor.black - public var textAlignment = UIControlContentHorizontalAlignment.center + public var textAlignment = UIControl.ContentHorizontalAlignment.center public var backgroundColor = UIColor.clear public var buttonHeight: CGFloat = 60 public var contentEdgeOffset = UIEdgeInsets.zero @@ -63,7 +63,7 @@ open class MIAlertController: UIViewController { } - public init(font: UIFont, textColor: UIColor, textAlignment: UIControlContentHorizontalAlignment, backgroundColor: UIColor, buttonHeight: CGFloat, contentEdgeOffset: UIEdgeInsets) { + public init(font: UIFont, textColor: UIColor, textAlignment: UIControl.ContentHorizontalAlignment, backgroundColor: UIColor, buttonHeight: CGFloat, contentEdgeOffset: UIEdgeInsets) { self.font = font self.textColor = textColor @@ -91,7 +91,7 @@ open class MIAlertController: UIViewController { return Config( font: UIFont.systemFont(ofSize: 16), textColor: UIColor(red: 33/255.0, green: 129/255.0, blue: 247/255.0, alpha: 1), - textAlignment: .center, + textAlignment: UIControl.ContentHorizontalAlignment.center, backgroundColor: UIColor.clear, buttonHeight: 60, contentEdgeOffset: UIEdgeInsets.zero @@ -102,7 +102,7 @@ open class MIAlertController: UIViewController { return Config( font: UIFont.boldSystemFont(ofSize: 16), textColor: UIColor(red: 218/255.0, green: 75/255.0, blue: 56/255.0, alpha: 1), - textAlignment: .center, + textAlignment: UIControl.ContentHorizontalAlignment.center, backgroundColor: UIColor.clear, buttonHeight: 60, contentEdgeOffset: UIEdgeInsets.zero @@ -113,7 +113,7 @@ open class MIAlertController: UIViewController { return Config( font: UIFont.boldSystemFont(ofSize: 16), textColor: UIColor(red: 33/255.0, green: 129/255.0, blue: 247/255.0, alpha: 1), - textAlignment: .center, + textAlignment: UIControl.ContentHorizontalAlignment.center, backgroundColor: UIColor.clear, buttonHeight: 60, contentEdgeOffset: UIEdgeInsets.zero @@ -142,10 +142,10 @@ open class MIAlertController: UIViewController { let button = UIButton(frame: CGRect(x: 0, y: 0, width: 100, height: config.buttonHeight)) - button.setTitle(title, for: UIControlState()) + button.setTitle(title, for: UIControl.State()) button.titleLabel?.adjustsFontSizeToFitWidth = true button.titleLabel?.minimumScaleFactor = 0.7 - button.setTitleColor(config.textColor, for: UIControlState()) + button.setTitleColor(config.textColor, for: UIControl.State()) button.titleLabel?.font = config.font button.backgroundColor = config.backgroundColor button.contentHorizontalAlignment = config.textAlignment @@ -439,7 +439,7 @@ open class MIAlertController: UIViewController { @objc fileprivate func buttonTapped(_ button: UIButton) { - if let buttonIndex = buttonsList.index(where: { $0 == button }) { + if let buttonIndex = buttonsList.firstIndex(where: { $0 == button }) { self.buttonTappedClosures?[buttonIndex]?() } diff --git a/Pods/Pods.xcodeproj/project.pbxproj b/Pods/Pods.xcodeproj/project.pbxproj index 1ac0acf..32b6c8a 100644 --- a/Pods/Pods.xcodeproj/project.pbxproj +++ b/Pods/Pods.xcodeproj/project.pbxproj @@ -230,14 +230,15 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0700; + LastUpgradeCheck = 1020; }; buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = 7DB346D0F39D3F0E887471402A8071AB; productRefGroup = 4779E38C495A048D9212160D6C51B314 /* Products */; @@ -285,25 +286,38 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 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; 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; + 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; CODE_SIGNING_REQUIRED = NO; COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "POD_CONFIGURATION_DEBUG=1", @@ -351,7 +365,7 @@ SDKROOT = iphoneos; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -362,6 +376,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 167CC5F74C82EC06A023C8760A2ECDEC /* Pods-MIAlertControllerDemo.debug.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -398,6 +413,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 014D4CB7C365E54EC8D832420D64A2FF /* Pods-MIAlertControllerDemo.release.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; @@ -454,7 +470,7 @@ PRODUCT_NAME = MIAlertController; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -465,24 +481,37 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 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; 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; + 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; CODE_SIGNING_REQUIRED = NO; COPY_PHASE_STRIP = YES; ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; GCC_PREPROCESSOR_DEFINITIONS = ( "POD_CONFIGURATION_RELEASE=1", "$(inherited)", @@ -496,6 +525,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.0; PROVISIONING_PROFILE_SPECIFIER = NO_SIGNING/; STRIP_INSTALLED_PRODUCT = NO; + SWIFT_COMPILATION_MODE = wholemodule; SYMROOT = "${SRCROOT}/../build"; VALIDATE_PRODUCT = YES; }; From 4e0897c44affadcf2bb9ef44665b98d9c14a0bfa Mon Sep 17 00:00:00 2001 From: Dionysios Bitros Date: Mon, 3 Jun 2019 17:14:49 +1200 Subject: [PATCH 2/8] Bumped podspec version --- MIAlertController.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MIAlertController.podspec b/MIAlertController.podspec index 1f0904c..6af6c97 100644 --- a/MIAlertController.podspec +++ b/MIAlertController.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = 'MIAlertController' - spec.version = '1.3' + spec.version = '1.4' spec.license = { :type => 'MIT', :file => 'LICENSE' } spec.homepage = 'https://github.com/MarioIannotta/MIAlertController' spec.authors = { 'Mario Iannotta' => 'info@marioiannotta.com' } From 454c629d206a270465634716730b1b298de43ca7 Mon Sep 17 00:00:00 2001 From: Dionysios Bitros Date: Mon, 3 Jun 2019 17:19:46 +1200 Subject: [PATCH 3/8] Podspec source to Song-Street --- MIAlertController.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MIAlertController.podspec b/MIAlertController.podspec index 6af6c97..6ecc078 100644 --- a/MIAlertController.podspec +++ b/MIAlertController.podspec @@ -5,7 +5,7 @@ Pod::Spec.new do |spec| spec.homepage = 'https://github.com/MarioIannotta/MIAlertController' spec.authors = { 'Mario Iannotta' => 'info@marioiannotta.com' } spec.summary = 'A simple fully customizable alert controller' - spec.source = { :git => 'https://github.com/MarioIannotta/MIAlertController.git', :tag => spec.version.to_s } + spec.source = { :git => 'https://github.com/Song-Street/MIAlertController.git', :tag => spec.version.to_s } spec.source_files = 'MIAlertController/*' spec.ios.deployment_target = '9.0' end \ No newline at end of file From 44f1148bf0b8f687add2d6118e91e1545cc9ed8a Mon Sep 17 00:00:00 2001 From: Dionysios Bitros Date: Mon, 3 Jun 2019 17:26:31 +1200 Subject: [PATCH 4/8] Podspec source to commit --- MIAlertController.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MIAlertController.podspec b/MIAlertController.podspec index 6ecc078..de22fd8 100644 --- a/MIAlertController.podspec +++ b/MIAlertController.podspec @@ -2,10 +2,10 @@ Pod::Spec.new do |spec| spec.name = 'MIAlertController' spec.version = '1.4' spec.license = { :type => 'MIT', :file => 'LICENSE' } - spec.homepage = 'https://github.com/MarioIannotta/MIAlertController' + spec.homepage = 'https://github.com/Song-Street/MIAlertController' spec.authors = { 'Mario Iannotta' => 'info@marioiannotta.com' } spec.summary = 'A simple fully customizable alert controller' - spec.source = { :git => 'https://github.com/Song-Street/MIAlertController.git', :tag => spec.version.to_s } + spec.source = { :git => 'https://github.com/Song-Street/MIAlertController.git', :tag => spec.version.to_s, :branch => 'Swift5-Xcode10_2', :commit => 'fc835c84f1ae758b569b87d0d6c73fa44de2b40d', } spec.source_files = 'MIAlertController/*' spec.ios.deployment_target = '9.0' end \ No newline at end of file From d701ce0b8cc22e48230ba0eb9ac1f899b2bfcd5f Mon Sep 17 00:00:00 2001 From: Dionysios Bitros Date: Mon, 3 Jun 2019 17:32:25 +1200 Subject: [PATCH 5/8] Podspec source change --- MIAlertController.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MIAlertController.podspec b/MIAlertController.podspec index de22fd8..01e62ba 100644 --- a/MIAlertController.podspec +++ b/MIAlertController.podspec @@ -5,7 +5,7 @@ Pod::Spec.new do |spec| spec.homepage = 'https://github.com/Song-Street/MIAlertController' spec.authors = { 'Mario Iannotta' => 'info@marioiannotta.com' } spec.summary = 'A simple fully customizable alert controller' - spec.source = { :git => 'https://github.com/Song-Street/MIAlertController.git', :tag => spec.version.to_s, :branch => 'Swift5-Xcode10_2', :commit => 'fc835c84f1ae758b569b87d0d6c73fa44de2b40d', } + spec.source = { :git => 'https://github.com/Song-Street/MIAlertController.git', :tag => spec.version.to_s, :commit => 'fc835c84f1ae758b569b87d0d6c73fa44de2b40d', } spec.source_files = 'MIAlertController/*' spec.ios.deployment_target = '9.0' end \ No newline at end of file From d138174b5dae29a0e80b91a5b2a88a9fd9177c3c Mon Sep 17 00:00:00 2001 From: Dionysios Bitros Date: Mon, 3 Jun 2019 19:52:45 +1200 Subject: [PATCH 6/8] Podspec source change again --- MIAlertController.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MIAlertController.podspec b/MIAlertController.podspec index 01e62ba..b91e20b 100644 --- a/MIAlertController.podspec +++ b/MIAlertController.podspec @@ -5,7 +5,7 @@ Pod::Spec.new do |spec| spec.homepage = 'https://github.com/Song-Street/MIAlertController' spec.authors = { 'Mario Iannotta' => 'info@marioiannotta.com' } spec.summary = 'A simple fully customizable alert controller' - spec.source = { :git => 'https://github.com/Song-Street/MIAlertController.git', :tag => spec.version.to_s, :commit => 'fc835c84f1ae758b569b87d0d6c73fa44de2b40d', } + spec.source = { :git => 'https://github.com/Song-Street/MIAlertController.git', :tag => spec.version.to_s, } spec.source_files = 'MIAlertController/*' spec.ios.deployment_target = '9.0' end \ No newline at end of file From 233c2c47d821265af51aa3a611a3fffd39b63ad7 Mon Sep 17 00:00:00 2001 From: Dionysios Bitros Date: Mon, 3 Jun 2019 19:55:44 +1200 Subject: [PATCH 7/8] Add workspace changes --- .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 MIAlertControllerDemo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/MIAlertControllerDemo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/MIAlertControllerDemo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/MIAlertControllerDemo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + From 35a8c74427d666c6e0f78e70784ac08840a964b6 Mon Sep 17 00:00:00 2001 From: Dionysios Bitros Date: Mon, 3 Jun 2019 20:04:16 +1200 Subject: [PATCH 8/8] Added missing updated MIAlertController.swift --- MIAlertController/MIAlertController.swift | 56 +++++++++++------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/MIAlertController/MIAlertController.swift b/MIAlertController/MIAlertController.swift index 8e72c26..8238b0f 100755 --- a/MIAlertController/MIAlertController.swift +++ b/MIAlertController/MIAlertController.swift @@ -33,7 +33,7 @@ open class MIAlertController: UIViewController { public var titleLabelTextAlignment = NSTextAlignment.center // Message - public var messageLabelFont = UIFont.systemFont(ofSize: 16) + public var messageLabelFont = UIFont.systemFont(ofSize: 16, weight: UIFont.Weight.light) public var messageLabelTextColor = UIColor.black public var messageLabelTextAlignment = NSTextAlignment.center public var messageVerticalSpaceFromTitle: CGFloat = 10 @@ -54,7 +54,7 @@ open class MIAlertController: UIViewController { public var font = UIFont.boldSystemFont(ofSize: 15) public var textColor = UIColor.black - public var textAlignment = UIControlContentHorizontalAlignment.center + public var textAlignment = UIControl.ContentHorizontalAlignment.center public var backgroundColor = UIColor.clear public var buttonHeight: CGFloat = 60 public var contentEdgeOffset = UIEdgeInsets.zero @@ -63,7 +63,7 @@ open class MIAlertController: UIViewController { } - public init(font: UIFont, textColor: UIColor, textAlignment: UIControlContentHorizontalAlignment, backgroundColor: UIColor, buttonHeight: CGFloat, contentEdgeOffset: UIEdgeInsets) { + public init(font: UIFont, textColor: UIColor, textAlignment: UIControl.ContentHorizontalAlignment, backgroundColor: UIColor, buttonHeight: CGFloat, contentEdgeOffset: UIEdgeInsets) { self.font = font self.textColor = textColor @@ -77,7 +77,7 @@ open class MIAlertController: UIViewController { } public enum `Type` { - + case `default` case destructive case cancel @@ -91,7 +91,7 @@ open class MIAlertController: UIViewController { return Config( font: UIFont.systemFont(ofSize: 16), textColor: UIColor(red: 33/255.0, green: 129/255.0, blue: 247/255.0, alpha: 1), - textAlignment: .center, + textAlignment: UIControl.ContentHorizontalAlignment.center, backgroundColor: UIColor.clear, buttonHeight: 60, contentEdgeOffset: UIEdgeInsets.zero @@ -102,7 +102,7 @@ open class MIAlertController: UIViewController { return Config( font: UIFont.boldSystemFont(ofSize: 16), textColor: UIColor(red: 218/255.0, green: 75/255.0, blue: 56/255.0, alpha: 1), - textAlignment: .center, + textAlignment: UIControl.ContentHorizontalAlignment.center, backgroundColor: UIColor.clear, buttonHeight: 60, contentEdgeOffset: UIEdgeInsets.zero @@ -113,7 +113,7 @@ open class MIAlertController: UIViewController { return Config( font: UIFont.boldSystemFont(ofSize: 16), textColor: UIColor(red: 33/255.0, green: 129/255.0, blue: 247/255.0, alpha: 1), - textAlignment: .center, + textAlignment: UIControl.ContentHorizontalAlignment.center, backgroundColor: UIColor.clear, buttonHeight: 60, contentEdgeOffset: UIEdgeInsets.zero @@ -142,10 +142,10 @@ open class MIAlertController: UIViewController { let button = UIButton(frame: CGRect(x: 0, y: 0, width: 100, height: config.buttonHeight)) - button.setTitle(title, for: UIControlState()) + button.setTitle(title, for: UIControl.State()) button.titleLabel?.adjustsFontSizeToFitWidth = true button.titleLabel?.minimumScaleFactor = 0.7 - button.setTitleColor(config.textColor, for: UIControlState()) + button.setTitleColor(config.textColor, for: UIControl.State()) button.titleLabel?.font = config.font button.backgroundColor = config.backgroundColor button.contentHorizontalAlignment = config.textAlignment @@ -197,7 +197,7 @@ open class MIAlertController: UIViewController { required public init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } - + public init(title: String? = nil, message: String? = nil, buttons: [Button]? = nil, config: Config? = nil) { super.init(nibName: "MIAlertController", bundle: Bundle(for: MIAlertController.self)) @@ -367,7 +367,7 @@ open class MIAlertController: UIViewController { // MARK: - Buttons stuff fileprivate func createButtons(_ buttons: [Button]?) { - + guard let buttons = buttons else { return } buttonsList = [UIButton]() @@ -383,7 +383,7 @@ open class MIAlertController: UIViewController { buttonsList.append(uiButton) } - + setupButtonsUI() } @@ -439,10 +439,10 @@ open class MIAlertController: UIViewController { @objc fileprivate func buttonTapped(_ button: UIButton) { - if let buttonIndex = buttonsList.index(where: { $0 == button }) { + if let buttonIndex = buttonsList.firstIndex(where: { $0 == button }) { self.buttonTappedClosures?[buttonIndex]?() } - + dismiss(animated: true, completion: nil) } @@ -457,7 +457,7 @@ open class MIAlertController: UIViewController { createButtons(alertButtons) setupUI() - + } // MARK: - IBActions @@ -466,7 +466,7 @@ open class MIAlertController: UIViewController { dismiss(animated: true, completion: nil) } } - + } // MARK: - CustomTransition stuff @@ -509,7 +509,7 @@ extension MIAlertController: UIViewControllerAnimatedTransitioning, UIViewContro let presentedController = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.to) as? MIAlertController, let presentedControllerView = transitionContext.view(forKey: UITransitionContextViewKey.to) - + else { return } let containerView = transitionContext.containerView @@ -538,11 +538,11 @@ extension MIAlertController: UIViewControllerAnimatedTransitioning, UIViewContro presentedController.view.alpha = 1 presentedController.alertBackgroundView.alpha = 1 - }, completion: {(completed: Bool) -> Void in - - transitionContext.completeTransition(completed) - - } + }, completion: {(completed: Bool) -> Void in + + transitionContext.completeTransition(completed) + + } ) @@ -554,7 +554,7 @@ extension MIAlertController: UIViewControllerAnimatedTransitioning, UIViewContro let presentedControllerView = transitionContext.view(forKey: UITransitionContextViewKey.from) else { return } - + UIView.animate( withDuration: transitionDuration(using: transitionContext), @@ -567,11 +567,11 @@ extension MIAlertController: UIViewControllerAnimatedTransitioning, UIViewContro presentedController.alertBackgroundView.transform = CGAffineTransform(scaleX: 0.9, y: 0.9) presentedControllerView.alpha = 0 - }, completion: {(completed: Bool) -> Void in - - transitionContext.completeTransition(completed) - - } + }, completion: {(completed: Bool) -> Void in + + transitionContext.completeTransition(completed) + + } )