Skip to content

Commit

Permalink
Added Xcode 11 (Swift 5.1) validations for color related changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hackiftekhar committed Sep 9, 2019
1 parent c6bb989 commit be56339
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 15 deletions.
4 changes: 4 additions & 0 deletions Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1122,6 +1122,7 @@
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = NO;
CLANG_WARN_UNREACHABLE_CODE = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
CURRENT_PROJECT_VERSION = 6.4.2;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
Expand Down Expand Up @@ -1157,6 +1158,7 @@
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = NO;
CLANG_WARN_UNREACHABLE_CODE = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
CURRENT_PROJECT_VERSION = 6.4.2;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
Expand Down Expand Up @@ -1326,6 +1328,7 @@
CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES;
CODE_SIGN_IDENTITY = "iPhone Developer: Iftekhar Qurashi (RFN29V7Q6Y)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 6.4.2;
DEVELOPMENT_TEAM = "";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
Expand Down Expand Up @@ -1361,6 +1364,7 @@
CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES;
CODE_SIGN_IDENTITY = "iPhone Developer: Iftekhar Qurashi (RFN29V7Q6Y)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 6.4.2;
DEVELOPMENT_TEAM = "";
GCC_C_LANGUAGE_STANDARD = c99;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
Expand Down
2 changes: 1 addition & 1 deletion Demo/Objective_C_Demo/Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>6.4.1</string>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
Expand Down
2 changes: 1 addition & 1 deletion Demo/Swift_Demo/Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>6.4.1</string>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
Expand Down
4 changes: 2 additions & 2 deletions IQKeyboardManager.podspec.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "IQKeyboardManager",
"version": "6.4.0",
"version": "6.4.2",
"source": {
"git": "https://github.com/hackiftekhar/IQKeyboardManager.git",
"tag": "v6.4.0"
"tag": "v6.4.2"
},
"summary": "Codeless drop-in universal library allows to prevent issues of keyboard sliding up and cover UITextField/UITextView.",
"homepage": "https://github.com/hackiftekhar/IQKeyboardManager",
Expand Down
Binary file not shown.
12 changes: 10 additions & 2 deletions IQKeyboardManager/IQTextView/IQTextView.m
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,16 @@ -(UILabel*)placeholderLabel
_placeholderLabel.font = self.font;
_placeholderLabel.textAlignment = self.textAlignment;
_placeholderLabel.backgroundColor = [UIColor clearColor];
_placeholderLabel.textColor = [UIColor lightTextColor];
// _placeholderLabel.textColor = [UIColor systemGrayColor]; //iOS 13
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
if (@available(iOS 13.0, *)) {
_placeholderLabel.textColor = [UIColor systemGrayColor];
} else
#endif
{
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 130000
_placeholderLabel.textColor = [UIColor lightTextColor];
#endif
}
_placeholderLabel.alpha = 0;
[self addSubview:_placeholderLabel];
}
Expand Down
24 changes: 20 additions & 4 deletions IQKeyboardManager/IQToolbar/IQTitleBarButtonItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,16 @@ -(nonnull instancetype)initWithTitle:(nullable NSString *)title
_titleButton = [UIButton buttonWithType:UIButtonTypeSystem];
_titleButton.enabled = NO;
_titleButton.titleLabel.numberOfLines = 3;
[_titleButton setTitleColor:[UIColor colorWithRed:0.0 green:0.5 blue:1.0 alpha:1.0] forState:UIControlStateNormal];
// [_titleButton setTitleColor:[UIColor systemBlueColor] forState:UIControlStateNormal]; //iOS 13
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
if (@available(iOS 13.0, *)) {
[_titleButton setTitleColor:[UIColor systemBlueColor] forState:UIControlStateNormal];
} else
#endif
{
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 130000
[_titleButton setTitleColor:[UIColor colorWithRed:0.0 green:0.5 blue:1.0 alpha:1.0] forState:UIControlStateNormal];
#endif
}
[_titleButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateDisabled];
[_titleButton setBackgroundColor:[UIColor clearColor]];
[_titleButton.titleLabel setTextAlignment:NSTextAlignmentCenter];
Expand Down Expand Up @@ -120,8 +128,16 @@ -(void)setTitleColor:(UIColor*)titleColor
-(void)setSelectableTitleColor:(UIColor*)selectableTitleColor
{
_selectableTitleColor = selectableTitleColor;
[_titleButton setTitleColor:_selectableTitleColor?:[UIColor colorWithRed:0.0 green:0.5 blue:1.0 alpha:1.0] forState:UIControlStateNormal];
// [_titleButton setTitleColor:_selectableTitleColor?:[UIColor systemBlueColor] forState:UIControlStateNormal]; //iOS 13
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
if (@available(iOS 13.0, *)) {
[_titleButton setTitleColor:_selectableTitleColor?:[UIColor systemBlueColor] forState:UIControlStateNormal];
} else
#endif
{
#if __IPHONE_OS_VERSION_MIN_REQUIRED < 130000
[_titleButton setTitleColor:_selectableTitleColor?:[UIColor colorWithRed:0.0 green:0.5 blue:1.0 alpha:1.0] forState:UIControlStateNormal];
#endif
}
}

-(void)setInvocation:(NSInvocation *)invocation
Expand Down
4 changes: 2 additions & 2 deletions IQKeyboardManagerSwift.podspec.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "IQKeyboardManagerSwift",
"version": "6.4.1",
"version": "6.4.2",
"source": {
"git": "https://github.com/hackiftekhar/IQKeyboardManager.git",
"tag": "v6.4.1"
"tag": "v6.4.2"
},
"summary": "Codeless drop-in universal library allows to prevent issues of keyboard sliding up and cover UITextField/UITextView.",
"homepage": "https://github.com/hackiftekhar/IQKeyboardManager",
Expand Down
5 changes: 4 additions & 1 deletion IQKeyboardManagerSwift/IQTextView/IQTextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,11 @@ open class IQTextView: UITextView {
label.font = self.font
label.textAlignment = self.textAlignment
label.backgroundColor = UIColor.clear
#if swift(>=5.1)
label.textColor = UIColor.systemGray
#else
label.textColor = UIColor.lightText
// label.textColor = UIColor.systemGray //For iOS13
#endif
label.alpha = 0
self.addSubview(label)

Expand Down
10 changes: 8 additions & 2 deletions IQKeyboardManagerSwift/IQToolbar/IQTitleBarButtonItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,11 @@ open class IQTitleBarButtonItem: IQBarButtonItem {
if let color = selectableTitleColor {
titleButton?.setTitleColor(color, for: .normal)
} else {
#if swift(>=5.1)
titleButton?.setTitleColor(UIColor.systemBlue, for: .normal)
#else
titleButton?.setTitleColor(UIColor(red: 0.0, green: 0.5, blue: 1.0, alpha: 1), for: .normal)
// titleButton?.setTitleColor(UIColor.systemBlue, for: .normal) //iO S13
#endif
}
}
}
Expand Down Expand Up @@ -111,8 +114,11 @@ open class IQTitleBarButtonItem: IQBarButtonItem {
titleButton?.isEnabled = false
titleButton?.titleLabel?.numberOfLines = 3
titleButton?.setTitleColor(UIColor.lightGray, for: .disabled)
#if swift(>=5.1)
titleButton?.setTitleColor(UIColor.systemBlue, for: .normal)
#else
titleButton?.setTitleColor(UIColor(red: 0.0, green: 0.5, blue: 1.0, alpha: 1), for: .normal)
// titleButton?.setTitleColor(UIColor.systemBlue, for: .normal) //iOS 13
#endif
titleButton?.backgroundColor = UIColor.clear
titleButton?.titleLabel?.textAlignment = .center
titleButton?.setTitle(title, for: .normal)
Expand Down

0 comments on commit be56339

Please sign in to comment.