IVIS
[편집] MainView.m
#import "mainView.h"
@implementation mainView
@synthesize label, timer;
- (id)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
// Initialization code
label = [[ UILabel alloc ] initWithFrame:CGRectMake(100,100,100,30)];
label.backgroundColor =[UIColor redColor];
[label setBackgroundColor:[UIColor yellowColor]];
[self addSubview:label];
label.frame = CGRectMake(180,200,120,30);
[label setText:@"안녕하세여~^^"];
label.textAlignment = UITextAlignmentRight;
label.textColor = [UIColor blueColor];
timer = [NSTimer scheduledTimerWithTimeInterval:0.3
target:self
selector:@selector(Ontimer)
userInfo:nil
repeats:YES
];
[self setNeedsDisplay];
}
return self;
}
- (void)drawRect:(CGRect)rect {
// Drawing code
NSLog(@"ParkMinHye");
}
- (void)dealloc {
[super dealloc];
}
-(void)Ontimer{
[self setNeedsDisplay];
}
@end