Created
July 1, 2016 13:19
-
-
Save stephenfeather/d138ea1ea7640b60905dde949885316e to your computer and use it in GitHub Desktop.
textStyle hack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(NSString*)TEXT_STYLE_TITLE1 | |
{ | |
if ([TiUtils isIOS9OrGreater]) { | |
return UIFontTextStyleTitle1; | |
} else { | |
return UIFontTextStyleBody; | |
} | |
} | |
-(NSString*)TEXT_STYLE_TITLE2 | |
{ | |
if ([TiUtils isIOS9OrGreater]) { | |
return UIFontTextStyleTitle2; | |
} else { | |
return UIFontTextStyleBody; | |
} | |
} | |
-(NSString*)TEXT_STYLE_TITLE3 | |
{ | |
if ([TiUtils isIOS9OrGreater]) { | |
return UIFontTextStyleTitle3; | |
} else { | |
return UIFontTextStyleBody; | |
} | |
} | |
-(NSString*)TEXT_STYLE_CALLOUT | |
{ | |
if ([TiUtils isIOS9OrGreater]) { | |
return UIFontTextStyleCallout; | |
} else { | |
return UIFontTextStyleBody; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(BOOL)isValidTextStyle:(NSString*)theStyle | |
{ | |
if ([TiUtils isIOS9OrGreater]) { | |
return ( | |
[theStyle isEqualToString:UIFontTextStyleBody] || | |
[theStyle isEqualToString:UIFontTextStyleCaption1] || | |
[theStyle isEqualToString:UIFontTextStyleCaption2] || | |
[theStyle isEqualToString:UIFontTextStyleHeadline] || | |
[theStyle isEqualToString:UIFontTextStyleSubheadline] || | |
[theStyle isEqualToString:UIFontTextStyleFootnote] || | |
[theStyle isEqualToString:UIFontTextStyleCallout] || | |
[theStyle isEqualToString:UIFontTextStyleTitle3] || | |
[theStyle isEqualToString:UIFontTextStyleTitle2] || | |
[theStyle isEqualToString:UIFontTextStyleTitle1] | |
); | |
} else { | |
return ( | |
[theStyle isEqualToString:UIFontTextStyleBody] || | |
[theStyle isEqualToString:UIFontTextStyleCaption1] || | |
[theStyle isEqualToString:UIFontTextStyleCaption2] || | |
[theStyle isEqualToString:UIFontTextStyleHeadline] || | |
[theStyle isEqualToString:UIFontTextStyleSubheadline] || | |
[theStyle isEqualToString:UIFontTextStyleFootnote] | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment