How to dismiss the iOS Keyboard when the done button is pressed

It has puzzled many generations how to get rid of the keyboard when the user is done entering text into an iOS text field. There doesn’t seem to be an obvious action we can attach to make this happen. That’s because rather than looking at the keyboard itself, we need to look at what actually […]

Links to the latest Social Icons

Facebook, Twitter & Co. change their brandings every now and again, and every time I need them for a project I keep scrambling to find the official links. Well no more – here’s a list of them all: Twitter: Facebook: LinkedIn: Apple and App Store:

How to read you App Version and Build from the Main Bundle

The required Version and Build numbers you add to Xcode make it into your app’s Main Bundle. You can retrieve those values from the Main Bundle and use them in your app. Here’s how: – (void)viewDidLoad { [super viewDidLoad]; // set version and build fields from bundle NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@”CFBundleShortVersionString”]; NSString […]

What are the button indexes in a three-button UIAlertView

The cancel button is always index 0, and all other buttons in the array start at index 1 counting up. For completion, here’s how to create it: – (IBAction)showAlert:(id)sender { // create an alert view with three buttons UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@”Three Button Alert” message:@”This is an alert view with more than two buttons. […]

How to restore your single In-App Purchase in iOS

This is an addition to my previous article. To allow uses to restore their In-App Purchases you can expand on the previous article and include the following method in your Shop class. This needs to be public so it can be called from your main class: – (BOOL)restoreThePurchase { // verify/refresh receipt here (even though […]