Skip to content

Commit be56339

Browse files
committed
Added Xcode 11 (Swift 5.1) validations for color related changes
1 parent c6bb989 commit be56339

File tree

10 files changed

+52
-15
lines changed

10 files changed

+52
-15
lines changed

Demo.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,6 +1122,7 @@
11221122
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = NO;
11231123
CLANG_WARN_UNREACHABLE_CODE = YES;
11241124
CODE_SIGN_IDENTITY = "iPhone Developer";
1125+
CURRENT_PROJECT_VERSION = 6.4.2;
11251126
ENABLE_STRICT_OBJC_MSGSEND = YES;
11261127
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
11271128
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
@@ -1157,6 +1158,7 @@
11571158
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = NO;
11581159
CLANG_WARN_UNREACHABLE_CODE = YES;
11591160
CODE_SIGN_IDENTITY = "iPhone Developer";
1161+
CURRENT_PROJECT_VERSION = 6.4.2;
11601162
ENABLE_NS_ASSERTIONS = NO;
11611163
ENABLE_STRICT_OBJC_MSGSEND = YES;
11621164
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
@@ -1326,6 +1328,7 @@
13261328
CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES;
13271329
CODE_SIGN_IDENTITY = "iPhone Developer: Iftekhar Qurashi (RFN29V7Q6Y)";
13281330
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1331+
CURRENT_PROJECT_VERSION = 6.4.2;
13291332
DEVELOPMENT_TEAM = "";
13301333
GCC_C_LANGUAGE_STANDARD = c99;
13311334
GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -1361,6 +1364,7 @@
13611364
CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES;
13621365
CODE_SIGN_IDENTITY = "iPhone Developer: Iftekhar Qurashi (RFN29V7Q6Y)";
13631366
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1367+
CURRENT_PROJECT_VERSION = 6.4.2;
13641368
DEVELOPMENT_TEAM = "";
13651369
GCC_C_LANGUAGE_STANDARD = c99;
13661370
GCC_PRECOMPILE_PREFIX_HEADER = YES;

Demo/Objective_C_Demo/Resources/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>6.4.1</string>
24+
<string>$(CURRENT_PROJECT_VERSION)</string>
2525
<key>LSRequiresIPhoneOS</key>
2626
<true/>
2727
<key>UILaunchStoryboardName</key>

Demo/Swift_Demo/Resources/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>
24-
<string>6.4.1</string>
24+
<string>$(CURRENT_PROJECT_VERSION)</string>
2525
<key>LSRequiresIPhoneOS</key>
2626
<true/>
2727
<key>UILaunchStoryboardName</key>

IQKeyboardManager.podspec.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "IQKeyboardManager",
3-
"version": "6.4.0",
3+
"version": "6.4.2",
44
"source": {
55
"git": "https://github.com/hackiftekhar/IQKeyboardManager.git",
6-
"tag": "v6.4.0"
6+
"tag": "v6.4.2"
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",

IQKeyboardManager/IQTextView/IQTextView.m

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,16 @@ -(UILabel*)placeholderLabel
165165
_placeholderLabel.font = self.font;
166166
_placeholderLabel.textAlignment = self.textAlignment;
167167
_placeholderLabel.backgroundColor = [UIColor clearColor];
168-
_placeholderLabel.textColor = [UIColor lightTextColor];
169-
// _placeholderLabel.textColor = [UIColor systemGrayColor]; //iOS 13
168+
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
169+
if (@available(iOS 13.0, *)) {
170+
_placeholderLabel.textColor = [UIColor systemGrayColor];
171+
} else
172+
#endif
173+
{
174+
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 130000
175+
_placeholderLabel.textColor = [UIColor lightTextColor];
176+
#endif
177+
}
170178
_placeholderLabel.alpha = 0;
171179
[self addSubview:_placeholderLabel];
172180
}

IQKeyboardManager/IQToolbar/IQTitleBarButtonItem.m

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,16 @@ -(nonnull instancetype)initWithTitle:(nullable NSString *)title
4848
_titleButton = [UIButton buttonWithType:UIButtonTypeSystem];
4949
_titleButton.enabled = NO;
5050
_titleButton.titleLabel.numberOfLines = 3;
51-
[_titleButton setTitleColor:[UIColor colorWithRed:0.0 green:0.5 blue:1.0 alpha:1.0] forState:UIControlStateNormal];
52-
// [_titleButton setTitleColor:[UIColor systemBlueColor] forState:UIControlStateNormal]; //iOS 13
51+
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
52+
if (@available(iOS 13.0, *)) {
53+
[_titleButton setTitleColor:[UIColor systemBlueColor] forState:UIControlStateNormal];
54+
} else
55+
#endif
56+
{
57+
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 130000
58+
[_titleButton setTitleColor:[UIColor colorWithRed:0.0 green:0.5 blue:1.0 alpha:1.0] forState:UIControlStateNormal];
59+
#endif
60+
}
5361
[_titleButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateDisabled];
5462
[_titleButton setBackgroundColor:[UIColor clearColor]];
5563
[_titleButton.titleLabel setTextAlignment:NSTextAlignmentCenter];
@@ -120,8 +128,16 @@ -(void)setTitleColor:(UIColor*)titleColor
120128
-(void)setSelectableTitleColor:(UIColor*)selectableTitleColor
121129
{
122130
_selectableTitleColor = selectableTitleColor;
123-
[_titleButton setTitleColor:_selectableTitleColor?:[UIColor colorWithRed:0.0 green:0.5 blue:1.0 alpha:1.0] forState:UIControlStateNormal];
124-
// [_titleButton setTitleColor:_selectableTitleColor?:[UIColor systemBlueColor] forState:UIControlStateNormal]; //iOS 13
131+
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
132+
if (@available(iOS 13.0, *)) {
133+
[_titleButton setTitleColor:_selectableTitleColor?:[UIColor systemBlueColor] forState:UIControlStateNormal];
134+
} else
135+
#endif
136+
{
137+
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 130000
138+
[_titleButton setTitleColor:_selectableTitleColor?:[UIColor colorWithRed:0.0 green:0.5 blue:1.0 alpha:1.0] forState:UIControlStateNormal];
139+
#endif
140+
}
125141
}
126142

127143
-(void)setInvocation:(NSInvocation *)invocation

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.4.1",
3+
"version": "6.4.2",
44
"source": {
55
"git": "https://github.com/hackiftekhar/IQKeyboardManager.git",
6-
"tag": "v6.4.1"
6+
"tag": "v6.4.2"
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/IQTextView/IQTextView.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,11 @@ open class IQTextView: UITextView {
8888
label.font = self.font
8989
label.textAlignment = self.textAlignment
9090
label.backgroundColor = UIColor.clear
91+
#if swift(>=5.1)
92+
label.textColor = UIColor.systemGray
93+
#else
9194
label.textColor = UIColor.lightText
92-
// label.textColor = UIColor.systemGray //For iOS13
95+
#endif
9396
label.alpha = 0
9497
self.addSubview(label)
9598

IQKeyboardManagerSwift/IQToolbar/IQTitleBarButtonItem.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,11 @@ open class IQTitleBarButtonItem: IQBarButtonItem {
6868
if let color = selectableTitleColor {
6969
titleButton?.setTitleColor(color, for: .normal)
7070
} else {
71+
#if swift(>=5.1)
72+
titleButton?.setTitleColor(UIColor.systemBlue, for: .normal)
73+
#else
7174
titleButton?.setTitleColor(UIColor(red: 0.0, green: 0.5, blue: 1.0, alpha: 1), for: .normal)
72-
// titleButton?.setTitleColor(UIColor.systemBlue, for: .normal) //iO S13
75+
#endif
7376
}
7477
}
7578
}
@@ -111,8 +114,11 @@ open class IQTitleBarButtonItem: IQBarButtonItem {
111114
titleButton?.isEnabled = false
112115
titleButton?.titleLabel?.numberOfLines = 3
113116
titleButton?.setTitleColor(UIColor.lightGray, for: .disabled)
117+
#if swift(>=5.1)
118+
titleButton?.setTitleColor(UIColor.systemBlue, for: .normal)
119+
#else
114120
titleButton?.setTitleColor(UIColor(red: 0.0, green: 0.5, blue: 1.0, alpha: 1), for: .normal)
115-
// titleButton?.setTitleColor(UIColor.systemBlue, for: .normal) //iOS 13
121+
#endif
116122
titleButton?.backgroundColor = UIColor.clear
117123
titleButton?.titleLabel?.textAlignment = .center
118124
titleButton?.setTitle(title, for: .normal)

0 commit comments

Comments
 (0)