January 2011
11 posts
8 tags
vector vector: NSDateFormatter format strings for... →
vectorvector: Format strings for processing dates from facebook or twitter’s json api’s //2010-09-12T22:21:18+0000 #define DF_FACEBOOK @"yyyy-MM-dd'T'HH:mm:ssZZ" // Sun Sep 12 17:06:56 +0000 2010 #define DF_TWITTER @"EEE LLL dd HH:mm:ss ZZ yyyy" Usage: NSDateFormatter *df = [[NSDateFormatter alloc]...
Jan 22nd
2 notes
8 tags
DMURLConnection →
vectorvector: A very very light wrapper for NSURLConnection. I wrote it, found it useful, thought that I would share. For when you need to send an HTTP post request and download some kind of response asynchronously.
Jan 22nd
2 notes
5 tags
vector vector: How to set default values for... →
vectorvector: NSUserDefaults is a great place to store your apps settings. It is convenient, available everywhere, and integrates nicely with settings bundles. One problem you run across with NSUserDefaults, is setting default values for your settings. There is a very simple elegant solution to this, detailed…
Jan 22nd
1 note
7 tags
Jan 21st
5 tags
Ignore touches to UIView subclass, but not to its...
vectorvector: If you want a UIView subclass to ignore touch events, just set its userInteractionEnabled property to NO. But that will block touches to all its subviews. To ignore touches in a UIView subclass, but not its subviews, just work a little hitTest magic: -(id)hitTest:(CGPoint)point withEvent:(UIEvent *)event { id hitView = [super hitTest:point withEvent:event]; if (hitView ==...
Jan 21st
8 notes
9 tags
iOS Interface Elements →
vectorvector: Some interface icons for iOS. Taken from my app Double Exposure, and put on github for the common good. Previous Next Settings Gear Swap Camera (Front/Rear) Camera Icon
Jan 21st
1 note
6 tags
vector vector: How to vertically center a... →
vectorvector: This took me ages to figure out how to vertically center the text in a UITextView. There really ought to be a property to set, but there isn’t so… this is pretty easy. In -(void)viewDidLoad, add this to observe the contentSize key value: [textView addObserver:self forKeyPath:@"contentSize"...
Jan 20th
4 notes
4 tags
Jan 20th
8 tags
Jan 19th
2 notes
7 tags
Jan 19th
1 note
1 tag
Jan 19th
929 notes