RSS

Convert Haxstring to RGB color

-(UIColor*)colorWithHexString:(NSString*)hexaColor
{
NSString *cString = [[hexaColor stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] uppercaseString];

if([cString length] < 6) return [UIColor grayColor];
if([cString hasPrefix:@”0X”]) cString = [cString substringFromIndex:2];
if([cString length] != 6) return [UIColor grayColor];

NSRange range;
range.location = 0;
range.length = 2;

NSString *rString = [cString substringWithRange:range];

range.location = 2;
NSString *gString = [cString substringWithRange:range];

range.location = 4;
NSString *bString = [cString substringWithRange:range];

unsigned int r, g, b;
[[NSScanner scannerWithString:rString] scanHexInt:&r];
[[NSScanner scannerWithString:gString] scanHexInt:&g];
[[NSScanner scannerWithString:bString] scanHexInt:&b];
NSLog(@”%i %i %i”, r,g,b);
return [UIColor colorWithRed:((float) r/255.0f) green:((float) g/255.0f) blue:((float) b/255.0f) alpha:1.0f];

}

 
Leave a comment

Posted by on August 28, 2014 in Uncategorized

 

Custom Annotation View Mapkit

Custom Annotation View Mapkit

 
Leave a comment

Posted by on August 25, 2014 in Uncategorized

 

Mapview with ResizableCircle Great Example

ResizableMKCircleOverlay

 
Leave a comment

Posted by on July 21, 2014 in Uncategorized

 

Dropdown iOS Example

NIDropDown

 
1 Comment

Posted by on July 20, 2014 in Uncategorized

 

iOSCombobox

iOSCombobox

 
Leave a comment

Posted by on July 15, 2014 in Uncategorized

 

IQKeyboardmanager with iOS 7 Support

IQKeyboardmanager

 
1 Comment

Posted by on July 15, 2014 in Uncategorized

 

RDVKeyboardAvoidingScrollView

RDVKeyboardAvoiding

 
Leave a comment

Posted by on July 15, 2014 in Uncategorized