随机颜色文件 用的时候直接推进去好方便

#import <UIKit/UIKit.h>

@interface UIColor (RandomColor)
//随机颜色
+ (UIColor *)randomColor;
@end


#import "UIColor+RandomColor.h"

@implementation UIColor (RandomColor)

+ (UIColor *)randomColor {
    return [self colorWithRed:arc4random() % 256 / 255.0 green:arc4random() % 256 / 255.0 blue:arc4random() % 256 / 255.0 alpha:1.0];
}


@end


原文地址:https://www.cnblogs.com/zhchoutai/p/7062997.html