@@ -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
0 commit comments