#define UIColorWithRGB(r,g,b) UIColorWithRGBA(r, g, b,1)
#define UIColorWithRGBA(r,g,b,a) [UIColor colorWithRed:r / 255.0 green:g / 255.0 blue:b / 255.0 alpha:a]
@interface ViewController ()
@property (nonatomic,strong) UIView *testView;
@end
- (void)viewDidload{
<span style="font-family: Arial, Helvetica, sans-serif;"> [super viewDidLoad];</span>
self.testView.backgroundColor = UIColorWithRGB(232, 42, 47);
[self.view addSubview:self.testView];
}
- (UIView *)testView{
if (!_testView) {
_testView = [[UIView alloc] initWithFrame:CGRectMake(40, 40, 100, 30)];
}
return _testView;
}
@end