Sunday, February 24, 2013

Adding UIViews to storyboards

A little gem of a post about adding views to a storyboard.

Tuesday, January 15, 2013

iOS Freemium Conversion Rate

The Rebus Show Free is a free iOS app that exists along side The Rebus Show which sells for $1.99. In the last 90 days, the free app's conversion rate of people purchasing the $1.99 upgrade is 7.3%. In the same period, the paid app earned about 20% more than the free app.

Sunday, January 13, 2013

Convert Storyboard from iPhone to iPad

This posting saved me a lot of time when creating an iPhone app from an existing iPad app. The comments contain useful info too.

UIImage imageNamed does not resolve device based names when the image name contains a period.

UIImage imageNamed does not resolve device based names when the image name contains a period.


Given an image named "ab~ipad.png" [UIImage imageNamed:@"ab"] WORKS
Given an image named "a.b~ipad.png" [UIImage imageNamed:@"a.b"] RETURNS NULL

Saturday, December 29, 2012

UIView to UIImage

A simple way to capture a UIView in a UIImage or PDF.

Import CaptureView.h/.m

For an image screenshot:

UIImage* screenshotImage = [CaptureView viewToImage:self.view];
For a PDF screenshot:
NSData* pdfData = [CaptureView viewToPdf:self.view];

Primitive values with NSArray & NSDictionary


NSArray+Primitive

NSArray+Primitive extends NSArray and NSMutableArray to provide support for primitivesBOOL, char, int, float, CGPoint, CGSize, CGRect. The following example demonstrates int but all the other types work the same way.
NSMutableArray* array = [NSMutableArray array];
[array addInt:1]; // array = [1]
[array addInt:2]; // array = [1, 2]
int i = [array intAtIndex:0]; // i = 1
[array swapIndex1:0 index2:1]; // array = [2, 1]
[array replaceIntAtIndex:0 withInt:3];  // array = [3, 1]
[array insertInt:4 atIndex:1];
NSLog(@"%@", [array description]); // console shows [3, 4, 1]

NSDictionary+Primitive

NSDictionary+Primitive extends NSDictionary and NSMutableDictionary to provide support for primitivesBOOL, char, int, float, CGPoint, CGSize, CGRect. The following example demonstrates int but all the other types work the same way.
NSMutableDictionary* dict = [NSMutableDictionary dictionary];
[dict setInt:1 forKey:@"int1"]; // dict = { int1:1 }
[dict setInt:2 forKey:@"int2"]; // dict = { int1:1, int2:2 }
int i = [dict intForKey:@"int1"]; // i = 1
NSLog(@"%@", [dict description]); // console shows { int1 = 1; int2 = 2; }