Skip to Content
Beginning iOS Game Center and Game Kit: For iPhone, iPad, and iPod touch
book

Beginning iOS Game Center and Game Kit: For iPhone, iPad, and iPod touch

by Kyle Richter
November 2011
Beginner content levelBeginner
238 pages
6h 19m
English
Apress
Content preview from Beginning iOS Game Center and Game Kit: For iPhone, iPad, and iPod touch

Tying Everything Together in UFOs

Depending on the complexity of your in-app purchase, it could be very easy or very difficult to integrate it into your code. In UFOs, we have a very simple product, in which paying a one-time fee unlocks a different colored ship. When the user purchases the product, we store a key in our user defaults to reflect that. To unlock this purchase in code, we simply check for that key, and then perform the required steps. To do this, we need to add some new art assets to the project. These have already been included in the Chapter 11 sample code (available at the Apress web site).

After this is done, we need to modify our viewDidLoad method to change the ship's image. The following code snippet shows those changes. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning ARKit for iPhone and iPad: Augmented Reality App Development for iOS

Beginning ARKit for iPhone and iPad: Augmented Reality App Development for iOS

Wallace Wang
iOS 4 in Action

iOS 4 in Action

Lin Harrington, Shannon Appelcline, Christopher R. Allen, Brandon Trebitowski
iOS 7 Development Recipes: A Problem-Solution Approach

iOS 7 Development Recipes: A Problem-Solution Approach

Joseph Hoffman, Hans-Eric Grönlund, Colin Francis, Shawn Grimes

Publisher Resources

ISBN: 9781430235279Purchase book