Проверка хайлайтера.
#import "MainView.h"
@implementation MainView
- (id)initWithFrame:(struct CGRect)frame
{
if ((self == [super initWithFrame:frame]) != nil)
{
frame.origin.x = frame.origin.y = 0.0f;
UITextLabel *text = [[UITextLabel alloc] initWithFrame:frame];
[text setText:@"Hello, world!"];
float white[4] = {1.0f, 1.0f, 1.0f, 1.0f};
float black[4] = {0.0f, 0.0f, 0.0f, 1.0f};
[text setBackgroundColor:CGColorCreate(CGColorSpaceCreateDeviceRGB(),white)];
[text setColor:CGColorCreate(CGColorSpaceCreateDeviceRGB(),black)];
[text setCentersHorizontally:YES];
[self addSubview:text];
}
return self;
}
@end
