Skip to content

Commit 2449845

Browse files
committed
Optimized IQKeyboardManagerSwift for swift4.2
1 parent 5552ad9 commit 2449845

File tree

5 files changed

+22
-7
lines changed

5 files changed

+22
-7
lines changed

Demo/Swift_Demo/AppDelegate.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2727
// Override point for customization after application launch.
2828

2929
IQKeyboardManager.shared.enable = true
30-
30+
IQKeyboardManager.shared.enableDebugging = true
31+
3132
return true
3233
}
3334
#endif

IQKeyboardManager.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@
729729
PRODUCT_NAME = "$(TARGET_NAME)";
730730
SKIP_INSTALL = YES;
731731
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
732-
SWIFT_VERSION = 4.0;
732+
SWIFT_VERSION = 4.2;
733733
};
734734
name = Debug;
735735
};
@@ -763,7 +763,7 @@
763763
PRODUCT_BUNDLE_IDENTIFIER = com.Iftekhar.IQKeyboardManagerSwift;
764764
PRODUCT_NAME = "$(TARGET_NAME)";
765765
SKIP_INSTALL = YES;
766-
SWIFT_VERSION = 4.0;
766+
SWIFT_VERSION = 4.2;
767767
};
768768
name = Release;
769769
};

IQKeyboardManagerSwift.podspec.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "IQKeyboardManagerSwift",
3-
"version": "6.0.5",
3+
"version": "6.0.6",
44
"source": {
55
"git": "https://github.com/hackiftekhar/IQKeyboardManager.git",
6-
"tag": "v6.0.5"
6+
"tag": "v6.0.6"
77
},
88
"summary": "Codeless drop-in universal library allows to prevent issues of keyboard sliding up and cover UITextField/UITextView.",
99
"homepage": "https://github.com/hackiftekhar/IQKeyboardManager",

IQKeyboardManagerSwift/IQToolbar/IQUIView+IQKeyboardToolbar.swift

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,24 @@ private var kIQKeyboardToolbar = "kIQKeyboardToolbar"
3434
*/
3535
public class IQBarButtonItemConfiguration : NSObject {
3636

37-
public init(barButtonSystemItem : UIBarButtonSystemItem, action: Selector) {
37+
#if swift(>=4.2)
38+
public init(barButtonSystemItem : UIBarButtonItem.SystemItem, action: Selector) {
3839
self.barButtonSystemItem = barButtonSystemItem
3940
self.image = nil
4041
self.title = nil
4142
self.action = action
4243
super.init()
4344
}
44-
45+
#else
46+
public init(barButtonSystemItem : UIBarButtonSystemItem, action: Selector) {
47+
self.barButtonSystemItem = barButtonSystemItem
48+
self.image = nil
49+
self.title = nil
50+
self.action = action
51+
super.init()
52+
}
53+
#endif
54+
4555
public init(image : UIImage, action: Selector) {
4656
self.barButtonSystemItem = nil
4757
self.image = image
@@ -58,7 +68,11 @@ public class IQBarButtonItemConfiguration : NSObject {
5868
super.init()
5969
}
6070

71+
#if swift(>=4.2)
72+
public let barButtonSystemItem : UIBarButtonItem.SystemItem? //System Item to be used to instantiate bar button.
73+
#else
6174
public let barButtonSystemItem : UIBarButtonSystemItem? //System Item to be used to instantiate bar button.
75+
#endif
6276

6377
public let image : UIImage? //Image to show on bar button item if it's not a system item.
6478

0 commit comments

Comments
 (0)