IOS Make Lable link class

//
//  UIBlinkLabel.h

#import <Foundation/Foundation.h>


@interface UIBlinkLabel : UILabel {
@private
    NSTimer *timer;
    NSTimeInterval blinkInterval;
}
-(id)initWithFrame:(CGRect)frame blinkFor:(NSTimeInterval) blInterval;
-(void)timerTick: (id)sender;
@end

//
//  UIBlinkLabel.m

#import "UIBlinkLabel.h"


@implementation UIBlinkLabel
-(id)initWithFrame:(CGRect)frame blinkFor:(NSTimeInterval)blInterval
{
    self = [super initWithFrame:frame];
    if (self) {
        blinkInterval = blInterval;
        timer = [NSTimer scheduledTimerWithTimeInterval:blinkInterval target:self selector:@selector(timerTick:) userInfo:nil repeats:YES];
    }
    return self;
}

-(void)timerTick:(id) sender
{
    self.hidden = !self.hidden;
}
-(void)dealloc
{
    [super dealloc];
}

@end

Comments

Popular posts from this blog

Java : Variables Declaring

Install DNF in RHEL/CentOS 7

SQL Self JOIN