iOS Custom UIButtons


Not only functionality is the driving factor of good applications, also the look and feel of your application is very important. This tutorial will guide you through some steps of creating custom buttons, this are buttons with a custom look and feel. The starting point of this tutorial is the StopWatch application.

Following customisations will be done:

  • Change the colour of a UIButton.
  • Style the label of a UIButton.
  • Use an image as UIButton background
  • Use gradients to create shiny buttons

Objective-C Singleton

What is a Singleton?

A singleton is a design pattern that restricts the instantiation of a class to a single object. This single object can be used across the complete application. It can be seen as a global state accessible from any piece of code inside the same application. The life cycle of this single object is typically from the instantiation point until the termination of the application. Typical examples for a singleton inside an iOS application are:

  • A controller object that manages user settings which need to be passed to every view.
  • An object that manages data that needs to be manipulated and displayed in several views.

Mixing iAd and Admob


Is it a real fact or just a rumour...I'm not sure yet...but:

  • iAd is not yet available in all countries but has a higher earning per impression and click-through
  • AdMob is available in almost every country but with a lower earning rate per impression and click-through

So why not just combine both?

It may look like a complex task but it is rather easy to accomplish. I will not fully explain how to setup iAd neither how to setup AdMob, but I will provide the directions on how to make both advertising platform work nicely together so you can maximise your earnings.

The main idea behind the implementation is to show iAd when available, if iAd is not available an Admob request will be made.


iOS SQLite Tutorial

What is SQLite?

SQLite is an embedded implementation of SQL. SQL stands for Structured Query Language and is a standard language to work with relational databases. SQLite can be embedded inside any application, so there is no need for a separate process running the database instance. It follows the principals of a Relational Database Management System (RDBMS). Inside a RDBMS data is stored inside tables and the relationship between this data is also stored inside tables.


iOS Stopwatch Tutorial


This tutorial creates a very simple stopwatch application that only consist of a start button, stop button and display label for the time.

Although the application setup is very simple it will introduce you the following important concepts:

  • UIViewController: one of the most used classes of UIKit when working with iOS applications that contains a UIView.
  • IBOutlet: represents a control in code.
  • IBAction: represents the action to take when a certain event occurs from interacting with a control.
  • NSTimer: represents a timer object that fires when a certain time interval has elapsed.
  • NSDate, NSTimeInterval and NSDateFormatter: essential classes when working with dates and times.

This tutorial assumes you have no knowledge of Xcode, Objective-C or Cocoa Touch. If you already have a basic knowledge you can jump to Chapter 4. Adding the timer functionality.If you want to get some more background on Xcode you can always follow our Xcode Tutorial


Xcode Tutorial: Hello World

What is Xcode?

Xcode is a package of developer tools that enables you to create iOS and Mac OS X application. Xcode is tightly integrated with the Cocoa and Cocoa Touchframeworks. The Cocoa framework enables you to create Mac OS X applications, Cocoa Touch is the iOS counterpart.

Part of the Xcode suite of tools are:

  • The Xcode IDE which allows you to edit your code, compile this code, run the resulting binary or even debug this binary.
  • Xcode IDE now also integrates a visual editor to create a stunning user interface. In older releases of Xcode this visual editor was called Interface Builder. But from version 4.0 and onwards the editor is fully integrated into Xcode.
  • The Apple LLVM Compiler enables you to build C, C++ and Objective-C applications all in the same project. This LLVM compiler can point out syntax errors while editing and even proposes solutions for these build errors.
  • Instruments allows you to analyse both performance and behaviour of your application. Real time feedback is provided about disk, memory and CPU usage. This is an essential tool to generate snappy applications!
  • Finally the iOS Simulator enables you to run and test your iOS application, both iPad and iPhone devices are included. Even Touch Gestures are supported inside the iOS Simulator.

But the best has yet to come, Xcode can be downloaded for free from the Mac App Store, only an Apple ID is required (which is also free).