Skip to content

Instantly share code, notes, and snippets.

@xr1337
xr1337 / gist:5704189
Created Jun 4, 2013
Add Round Touch to View Controller
View gist:5704189
#import "ViewController.h"
#import "RoundTouchButton.h"
@xr1337
xr1337 / gist:5704181
Last active Dec 18, 2015
RoundTouchButton 1
View gist:5704181
#import "RoundTouchButton.h"
@implementation RoundTouchButton
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
}
@xr1337
xr1337 / gist:5704176
Last active Dec 18, 2015
ViewController 1
View gist:5704176
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
@xr1337
xr1337 / gist:5318147
Created Apr 5, 2013
Taken from https://gist.github.com/iangmaia/3368412 and added an ignore to certain URL schemes such as mailto
View gist:5318147
- (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]];