This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation RoundTouchButton{ | |
CGPathRef touchPath; | |
} | |
- (id)initWithFrame:(CGRect)frame | |
{ | |
self = [super initWithFrame:frame]; | |
if (self) { | |
// Initialization code | |
touchPath = CGPathCreateWithEllipseInRect(CGRectMake(0, 0, self.frame.size.width, self.frame.size.height), NULL); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "ViewController.h" | |
#import "RoundTouchButton.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
// Do any additional setup after loading the view from its nib. | |
RoundTouchButton *rtb = [[RoundTouchButton alloc]initWithFrame:CGRectMake(0, 0, 200, 200)]; | |
rtb.backgroundColor = [UIColor orangeColor]; | |
[rtb addTarget:self action:@selector(rtbTapped) forControlEvents:UIControlEventTouchUpInside]; | |
[self.view addSubview:rtb]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "ViewController.h" | |
@interface ViewController () | |
@end | |
@implementation ViewController | |
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSArray *) extractLinksFromString:(NSString*)txt ignoreSchemes:(NSArray*)ignoreSchemes{ | |
NSError *error = NULL; | |
NSDataDetector *detector = [NSDataDetector dataDetectorWithTypes:NSTextCheckingTypeLink error:&error]; | |
if (error) return nil; | |
NSArray *linkMatches = [detector matchesInString:txt options:0 range:NSMakeRange(0, txt.length)]; | |
NSMutableArray *result = [NSMutableArray arrayWithCapacity:[linkMatches count]]; |
NewerOlder