diff --git a/.swift-version b/.swift-version
index 389f774..bf77d54 100644
--- a/.swift-version
+++ b/.swift-version
@@ -1 +1 @@
-4.0
\ No newline at end of file
+4.2
diff --git a/Library/PMAlertAction.swift b/Library/PMAlertAction.swift
index 23bdd55..9271c84 100644
--- a/Library/PMAlertAction.swift
+++ b/Library/PMAlertAction.swift
@@ -33,11 +33,11 @@ import UIKit
self.action = action
self.addTarget(self, action: #selector(PMAlertAction.tapped(_:)), for: .touchUpInside)
- self.setTitle(title, for: UIControlState())
+ self.setTitle(title, for: UIControl.State())
self.titleLabel?.font = UIFont(name: "Avenir-Heavy", size: 17)
self.actionStyle = style
- style == .default ? (self.setTitleColor(UIColor(red: 191.0/255.0, green: 51.0/255.0, blue: 98.0/255.0, alpha: 1.0), for: UIControlState())) : (self.setTitleColor(UIColor.gray, for: UIControlState()))
+ style == .default ? (self.setTitleColor(UIColor(red: 191.0/255.0, green: 51.0/255.0, blue: 98.0/255.0, alpha: 1.0), for: UIControl.State())) : (self.setTitleColor(UIColor.gray, for: UIControl.State()))
self.addSeparator()
}
diff --git a/Library/PMAlertController.swift b/Library/PMAlertController.swift
index d778572..99e545e 100755
--- a/Library/PMAlertController.swift
+++ b/Library/PMAlertController.swift
@@ -47,24 +47,22 @@ import UIKit
override open func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
- NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow(_:)), name:NSNotification.Name.UIKeyboardWillShow, object: nil)
- NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide(_:)), name:NSNotification.Name.UIKeyboardWillHide, object: nil)
+ NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow(_:)), name: UIResponder.keyboardWillShowNotification, object: nil)
+ NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide(_:)), name: UIResponder.keyboardWillHideNotification, object: nil)
}
open override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
- NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillShow, object: nil)
- NotificationCenter.default.removeObserver(self, name: NSNotification.Name.UIKeyboardWillHide, object: nil)
+ NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillShowNotification, object: nil)
+ NotificationCenter.default.removeObserver(self, name: UIResponder.keyboardWillHideNotification, object: nil)
}
//MARK: - Initialiser
@objc public convenience init(title: String, description: String, image: UIImage?, style: PMAlertControllerStyle) {
self.init()
- let nib = loadNibAlertController()
- if nib != nil{
- self.view = nib![0] as! UIView
- }
+ guard let nib = loadNibAlertController(), let unwrappedView = nib[0] as? UIView else { return }
+ self.view = unwrappedView
self.modalPresentationStyle = UIModalPresentationStyle.overCurrentContext
self.modalTransitionStyle = UIModalTransitionStyle.crossDissolve
@@ -198,7 +196,7 @@ import UIKit
keyboardHasBeenShown = true
guard let userInfo = (notification as NSNotification).userInfo else {return}
- guard let endKeyBoardFrame = (userInfo[UIKeyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue.minY else {return}
+ guard let endKeyBoardFrame = (userInfo[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue.minY else {return}
if tempFrameOrigin == nil {
tempFrameOrigin = alertView.frame.origin
diff --git a/PMAlertController.podspec b/PMAlertController.podspec
index b3af3a6..a559bf9 100644
--- a/PMAlertController.podspec
+++ b/PMAlertController.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "PMAlertController"
- s.version = "3.4.0"
+ s.version = "3.5.0"
s.summary = "PMAlertController is a great and customizable substitute to UIAlertController"
s.description = <<-DESC
PMAlertController is a small library that allows you to substitute the uncustomizable UIAlertController of Apple, with a beautiful and totally customizable alert that you can use in your iOS app. Enjoy!
diff --git a/PMAlertController.xcodeproj/project.pbxproj b/PMAlertController.xcodeproj/project.pbxproj
index 3e31d2a..4136ef0 100755
--- a/PMAlertController.xcodeproj/project.pbxproj
+++ b/PMAlertController.xcodeproj/project.pbxproj
@@ -538,7 +538,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
- SWIFT_VERSION = 4.0;
+ SWIFT_VERSION = 4.2;
};
name = Debug;
};
@@ -556,7 +556,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
- SWIFT_VERSION = 4.0;
+ SWIFT_VERSION = 4.2;
};
name = Release;
};
@@ -623,7 +623,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
- SWIFT_VERSION = 4.0;
+ SWIFT_VERSION = 4.2;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
@@ -647,7 +647,7 @@
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
- SWIFT_VERSION = 4.0;
+ SWIFT_VERSION = 4.2;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
diff --git a/PMAlertController/Info.plist b/PMAlertController/Info.plist
index c37e387..dc51e0c 100644
--- a/PMAlertController/Info.plist
+++ b/PMAlertController/Info.plist
@@ -15,7 +15,7 @@