Skip to content
Ilho Ahn edited this page Nov 19, 2013 · 4 revisions

##Summary Automatic UI configurations. Example. SetText on UITextField, If text is not nil.

  • SettingText

##SettingText

####+ (void) putIfNotnillOrLength0:(NSString )str toUI:(UIView) target ####+ (void) putIfNotnillOrLength0:(NSString )str toTextField:(UITextField) target ####+ (void) putIfNotnillOrLength0:(NSString )str toButton:(UIButton) target ####+ (void) putIfNotnillOrLength0:(NSString )str toLabel:(UILabel) target;

SetText or setTitle, If str is not nil and not length0

Example)

// Not nil value
NSString *gettingText = @"buttonText";
[UIRobot putIfNotnillOrLength0:gettingText toButton:self.ui_button];

// nil value do not set target ui
NSString *gettingText = nil;
[UIRobot putIfNotnillOrLength0:gettingText toButton:self.ui_button];

// no length do not set target ui
NSString *gettingText = @"";
[UIRobot putIfNotnillOrLength0:gettingText toButton:self.ui_button];

Make ArrtibuedString

+ (NSAttributedString *)makeAttribuedTitle:(NSString *)titleStr highilightStr:(NSString *)highlightStr color:(UIColor *)highlightColor;

+ (NSAttributedString *)makeAttribuedTitle:(NSString *)titleStr textColor:(UIColor *)titleColor highilightStr:(NSString *)highlightStr color:(UIColor *)highlightColor;

Example)

[UIRobot makeAttribuedTitle:@"FULL TEXT IN HIGHLIGHT"
                                 textColor:[UIColor blackColor]
                             highilightStr:@"HIGHLIGHT"
                                     color:[UIColor redColor]];

Version

Version 0.0.1 Build 61 Release 1