core-graphics
How to form CGPoint array in Objective-C?
For iOS: Create array: NSArray *myCGPointArray = @[[NSValue valueWithCGPoint:CGPointMake(30.0, 150.0)],[NSValue valueWithCGPoint:CGPointMake(41.67, 145.19)]]; Get 1st CGPoint object: CGPoint myPoint = [myCGPointArray[0] CGPointValue];
How can I tint a UIImage with gradient?
EDIT: Here is a version which supports non-retina and retina displays The method can be used as a category for UIImage + (UIImage *)imageWithGradient:(UIImage *)img startColor:(UIColor *)color1 endColor:(UIColor *)color2 { UIGraphicsBeginImageContextWithOptions(img.size, NO, img.scale); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextTranslateCTM(context, 0, img.size.height); CGContextScaleCTM(context, 1.0, -1.0); CGContextSetBlendMode(context, kCGBlendModeNormal); CGRect rect = CGRectMake(0, 0, img.size.width, img.size.height); //CGContextDrawImage(context, rect, img.CGImage); … Read more