diff --git a/Demo/Objective_C_Demo/Resources/Info.plist b/Demo/Objective_C_Demo/Resources/Info.plist index 16cea5c2..064e94a3 100755 --- a/Demo/Objective_C_Demo/Resources/Info.plist +++ b/Demo/Objective_C_Demo/Resources/Info.plist @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleVersion - 3.3.1 + 3.3.2 LSRequiresIPhoneOS UIMainStoryboardFile diff --git a/Demo/Swift_Demo/Resources/Info.plist b/Demo/Swift_Demo/Resources/Info.plist index 634112e2..0f29b4fe 100644 --- a/Demo/Swift_Demo/Resources/Info.plist +++ b/Demo/Swift_Demo/Resources/Info.plist @@ -19,7 +19,7 @@ CFBundleSignature ???? CFBundleVersion - 3.3.1 + 3.3.2 LSRequiresIPhoneOS UIMainStoryboardFile diff --git a/IQKeyboardManagerSwift/Constants/IQKeyboardManagerConstantsInternal.swift b/IQKeyboardManagerSwift/Constants/IQKeyboardManagerConstantsInternal.swift index 59685695..ef0e799c 100644 --- a/IQKeyboardManagerSwift/Constants/IQKeyboardManagerConstantsInternal.swift +++ b/IQKeyboardManagerSwift/Constants/IQKeyboardManagerConstantsInternal.swift @@ -43,6 +43,3 @@ public enum IQLayoutGuidePosition : Int { case Top case Bottom } - - -internal let IQ_IS_IOS8_OR_GREATER = (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_7_1) diff --git a/IQKeyboardManagerSwift/IQKeyboardManager.swift b/IQKeyboardManagerSwift/IQKeyboardManager.swift index 85cb6267..5fe4fed5 100644 --- a/IQKeyboardManagerSwift/IQKeyboardManager.swift +++ b/IQKeyboardManagerSwift/IQKeyboardManager.swift @@ -723,7 +723,7 @@ public class IQKeyboardManager: NSObject, UIGestureRecognizerDelegate { if let unwrappedController = controller { //frame size needs to be adjusted on iOS8 due to orientation structure changes. - if IQ_IS_IOS8_OR_GREATER == true { + if #available(iOS 8.0, *) { frame.size = unwrappedController.view.frame.size } @@ -784,7 +784,13 @@ public class IQKeyboardManager: NSObject, UIGestureRecognizerDelegate { let textFieldViewRect = optionalTextFieldViewRect! //If it's iOS8 then we should do calculations according to portrait orientations. // (Bug ID: #64, #66) - let interfaceOrientation = (IQ_IS_IOS8_OR_GREATER) ? UIInterfaceOrientation.Portrait : rootController.interfaceOrientation + let interfaceOrientation : UIInterfaceOrientation + + if #available(iOS 8.0, *) { + interfaceOrientation = UIInterfaceOrientation.Portrait + } else { + interfaceOrientation = rootController.interfaceOrientation + } // Getting RootViewRect. var rootViewRect = rootController.view.frame @@ -1416,7 +1422,7 @@ public class IQKeyboardManager: NSObject, UIGestureRecognizerDelegate { if let rootViewController = _rootViewController { //frame size needs to be adjusted on iOS8 due to orientation API changes. - if IQ_IS_IOS8_OR_GREATER == true { + if #available(iOS 8.0, *) { _topViewBeginRect.size = rootViewController.view.frame.size } diff --git a/IQKeyboardManagerSwift/IQToolbar/IQUIView+IQKeyboardToolbar.swift b/IQKeyboardManagerSwift/IQToolbar/IQUIView+IQKeyboardToolbar.swift index 44654923..271639fe 100644 --- a/IQKeyboardManagerSwift/IQToolbar/IQUIView+IQKeyboardToolbar.swift +++ b/IQKeyboardManagerSwift/IQToolbar/IQUIView+IQKeyboardToolbar.swift @@ -633,7 +633,7 @@ public extension UIView { let prev : IQBarButtonItem let next : IQBarButtonItem - if IQ_IS_IOS8_OR_GREATER { + if #available(iOS 8.0, *) { // Get the top level "bundle" which may actually be the framework var bundle = NSBundle(forClass: IQKeyboardManager.self) @@ -769,7 +769,7 @@ public extension UIView { let prev : IQBarButtonItem let next : IQBarButtonItem - if IQ_IS_IOS8_OR_GREATER { + if #available(iOS 8.0, *) { // Get the top level "bundle" which may actually be the framework var bundle = NSBundle(forClass: IQKeyboardManager.self)