samedi 29 mai 2010

Some basic templates for Iphone coding

Starting up a simple Iphone app, without much coding...:-)

Step 0:
a link to a photoshop template:
http://www.teehanlax.com/blog/2009/06/18/iphone-gui-psd-30/

Step 1:
download the 3GB Xcode with simulator:
http://developer.apple.com/technology/xcode.html

Step 2:
A very basic template with 5 backgrounds is downloadable here:
ExampleTemplateView5.zip

Step 3:
Unzip the folder and look at the contents:
iphonehelp3.jpg

and all the possible other steps:-)

start with editing the pictures, 320 x 480 pixels, and save the changed pictures in the folder under the same names,

OR, change the names in the folder AND in the code, see next image:
iphonehelp1.jpg

You can also add images immediately to the xcode. Then these images have to be dragged in the space under the other images in the space at the left side of the xcode window, so under Groups and Files and Resources...see this image:
iphonehelp4.jpg

After dragging the image in the right place, you get a window asking to add the image to the destination folder: check Copy radiobutton...
iphonehelp5.jpg

Then get the simulation running by clicking the green button with the hammer, the BUILD
iphonehelp2.jpg

When changing the images do a STOP and then again a BUILD.
Other example with the splash, the middle images and the finishing page:

download a template with splash, (starting screen) some basic backgrounds, (in a slideshow) and a finishing page:

ExampleTemplateView4.zip

the bit of code you have to add to get your image on top of a background:

UIImageView *imageAdded = [[UIImageView alloc] initWithImage: [UIImage imageNamed:@"myImageName.jpg"]];
[background addSubview: imageAdded];
imageAdded.center = CGPointMake(160,150); //position of center
imageAdded.alpha = .7;//transparency

-----

the backgrounds can be found in the file GameOverViewController.m

under " - (void)touchesBegan:"


more examples and templates on www.iphoneinsandouts.wordpress.com

on this last blog you can find more templates, tricks and design links. We did a class of about ten weeks and we have two app's in the appstore as a result of this. All kind of examples can be found with source code!

Check out two results: Google on "Aaipet appstore", and "Chameleon feeder appstore"

let us all make FREE games for ALL!!!!!!!