From 3f31c45feae664bcd81615796ab444e1ff450d54 Mon Sep 17 00:00:00 2001 From: iftekhar_qurashi Date: Thu, 1 Aug 2019 19:58:52 +0530 Subject: [PATCH] - Fixed a compilation issue for swift version lesser than 4.2 --- Demo/Objective_C_Demo/Resources/Info.plist | 2 +- Demo/Swift_Demo/Resources/Info.plist | 2 +- IQKeyboardManagerSwift.podspec.json | 4 ++-- IQKeyboardManagerSwift/IQKeyboardManager.swift | 8 +++++++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Demo/Objective_C_Demo/Resources/Info.plist b/Demo/Objective_C_Demo/Resources/Info.plist index a8d593c0..7cb8b778 100755 --- a/Demo/Objective_C_Demo/Resources/Info.plist +++ b/Demo/Objective_C_Demo/Resources/Info.plist @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleVersion - 6.4.0 + 6.4.1 LSRequiresIPhoneOS UILaunchStoryboardName diff --git a/Demo/Swift_Demo/Resources/Info.plist b/Demo/Swift_Demo/Resources/Info.plist index 018921ec..d65916f7 100644 --- a/Demo/Swift_Demo/Resources/Info.plist +++ b/Demo/Swift_Demo/Resources/Info.plist @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleVersion - 6.4.0 + 6.4.1 LSRequiresIPhoneOS UILaunchStoryboardName diff --git a/IQKeyboardManagerSwift.podspec.json b/IQKeyboardManagerSwift.podspec.json index 73e3b1b2..23d776c9 100644 --- a/IQKeyboardManagerSwift.podspec.json +++ b/IQKeyboardManagerSwift.podspec.json @@ -1,9 +1,9 @@ { "name": "IQKeyboardManagerSwift", - "version": "6.4.0", + "version": "6.4.1", "source": { "git": "https://github.com/hackiftekhar/IQKeyboardManager.git", - "tag": "v6.4.0" + "tag": "v6.4.1" }, "summary": "Codeless drop-in universal library allows to prevent issues of keyboard sliding up and cover UITextField/UITextView.", "homepage": "https://github.com/hackiftekhar/IQKeyboardManager", diff --git a/IQKeyboardManagerSwift/IQKeyboardManager.swift b/IQKeyboardManagerSwift/IQKeyboardManager.swift index fa64ced6..c93dd7ab 100644 --- a/IQKeyboardManagerSwift/IQKeyboardManager.swift +++ b/IQKeyboardManagerSwift/IQKeyboardManager.swift @@ -1858,7 +1858,13 @@ Codeless drop-in universal library allows to prevent issues of keyboard sliding currentStatusBarOrientation = UIApplication.shared.statusBarOrientation #endif - guard let statusBarOrientation = notification.userInfo?[UIApplication.statusBarOrientationUserInfoKey] as? Int, currentStatusBarOrientation.rawValue != statusBarOrientation else { + #if swift(>=4.2) + let statusBarUserInfoKey = UIApplication.statusBarOrientationUserInfoKey + #else + let statusBarUserInfoKey = UIApplicationStatusBarOrientationUserInfoKey + #endif + + guard let statusBarOrientation = notification.userInfo?[statusBarUserInfoKey] as? Int, currentStatusBarOrientation.rawValue != statusBarOrientation else { return }