Objective-C Language Categories Declaring a class method

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

Header file UIColor+XYZPalette.h:

@interface UIColor (XYZPalette)

+(UIColor *)xyz_indigoColor;

@end

and implementation UIColor+XYZPalette.m:

@implementation UIColor (XYZPalette)

+(UIColor *)xyz_indigoColor
{
    return [UIColor colorWithRed:75/255.0f green:0/255.0f blue:130/255.0f alpha:1.0f];
}

@end


Got any Objective-C Language Question?