Category Archives: Tutorials

Tutorial: Storyboard app with Core Data

It was my original intention to make a universal application for iPhone and iPad but due to time constraints I’m going to throw out this tutorial on using Core Data instead. With a bit of luck it’ll help someone out! A quick note before you start, so you’re not confused later – one of the screenshots later is missing an add button. Don’t worry if yours has one – I moved a chunk of the tutorial to make it easier to follow.

This tutorial will probably take about half an hour if you’re following it carefully. Good luck! Continue reading

Tutorial: Storyboard in XCode 4.2 with Navigation Controller and Tabbar Controller (Part 2)

Hello again!  If you’re reading this tutorial I’m going to assume that you read part 1 and are ready to continue.  In this tutorial we will take the project from part 1 and expand the second tab (the table) to include some actual table data and a transition to a ‘detail’ screen.  In this instance I’m using movie names and movie images to make it look pretty.  There’s a tiny bit of coding taking place here, but nothing exceptional.  We won’t be making use of Core Data at this stage, just to keep things simple.  Lets get on with it shall we?  (*keep in mind this was written in a hurry, but has been tested!*)

Continue reading

Tutorial: Storyboard in XCode 4.2 with Navigation Controller and Tabbar Controller (Part 1)

Based upon the fact that there are still very few tutorials on how to use the storyboarding stuff in Xcode 4.2 (iOS 5) – I’ve decided to write this second and slightly more complicated tutorial. The output of the tutorial will be an app which uses a tab bar, navigation controllers and a table view controller. It won’t be the most complex of tutorials but should serve to help those who are confused about wiring up a slightly more complex view controller setup. In this part, we will set up the bulk of the work and get some views working. In part 2, we will look at the table side of things.

Before we start, you should download the image pack (below) for the tab bar images I’ll be using. These images are beautifully crafted by Joseph Wain from Glyphish.com. As a side note, Joseph has just released Glyphish Pro 3 which can be purchased from his website for very little money!  It includes 400 icons for iPhone and iPad development that are an absolute must for developers! The images are reused here with permission. Of course, if you’d prefer to have imageless tab bar items then feel free to skip this step (and the image assignment steps later on) but it won’t look as cool!

Continue reading

Tutorial: Basic Storyboard in XCode 4.2

Today I’m going to present a very brief tutorial on how to use storyboarding in Xcode 4.2.  When storyboarding appeared it was pretty intimidating compared to how Interface Builder used to work and I felt that Apple really threw a curve ball with this one. In reality it’s really not all that bad when you start to use it.  The tutorial will show (from scratch) how to link two view controllers with a button, without coding a single line!  Lets jump right in and create a new Xcode project.

 

Continue reading

A basic MapView and annotation tutorial

Map viewI suppose it was inevitable that I’d end up needing to use the Mapkit on iPhone.  For a current project I’ve been required to plot a location on a map so looked at a straight forward way to achieve what I was after.  Thankfully, iPhone makes it very easy to do this.

The following tutorial takes you through creating a project from scratch, which will plot a single point from latitude and longitude coordinates and zoom to that position. Continue reading

Putting a UINavigationController within a UITabbarController

There seem to be quite a few people asking how to use a UINavigationController within a UITabbarController so I decided to put together this very quick tutorial.  We will build a very small (useless) app which will consist of the following…

  • A tab bar with two tab bar items
  • The first tab item will have a standard view controller
  • The second tab item will have a view controller backed by a navigation controller
  • A button which pushes a new view onto the nav controller
  • All of these views will be bound together programatically in the app delegate.

So our application won’t do much – but you’ll get to see one way of making it all fit together.  Okay, here goes. Continue reading

Cropping a UIImage on iPhone

As part of a larger project, I was faced with the mini challenge of cropping a UIImage. Seems like a straightforward thing to do (and in fact, it was when I’d finished looking into various ways of doing it).

My requirement was to take an existing UIImage and crop off the top section of the image. To the left, you should see a poor diagram of the crop I wanted to make.  The green area (the full size of the image) is my original image, weighing in at 320 pixels by 480 pixels.  The red area is the area I wanted to be left with, which was to be 320 pixels by 430 pixels (a cutting of 50 pixels off the top!). Lets do it! Continue reading