Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
iOS 7 Option Screens for UIView or Sprite Kit Based Apps
Rating: 4.5 out of 5(10 ratings)
384 students
Created byJustin Dike
Last updated 3/2014
English

What you'll learn

  • Create a fully functioning option or preferences screen for an iOS app.

Course content

4 sections20 lectures4h 43m total length
  • Introduction to the course3:26
  • AppData Singleton9:33

    In this video, we'll create a singleton class to store values which we will pass back and forth between the main app's class (or game engine) and the options screen.

  • Creating the Options Screen13:59

    In this tutorial we will create the OptionScreen class to be used with either a UIView class called MainGame or with a Sprite Kit based class. We'll test the classes with simple NSLog statements, in both projects.

  • Using a UIButton to Launch the OptionScreen19:12

    In this video we will create a UIButton to launch the OptionScreen from either a UIView project or Sprite Kit project. We will look at positioning and sizing the button differently based on the device. And we will also format the title of the button using a UIFont.

  • Opening and Closing the Options Screen21:54

    In this vide we will finally show something in our Options Screen. To have a bit of fun, we will make the screen open overtop the main app (or game class) at about 95% of the device's height and width, leaving a border around the Option Screen to the class below. Then we will test using the touchesBegan method to see if the user touches outside of that border, if so we return to whatever class opened the Options Screen.

  • NSTimer / SKAction for Fading and Tinting20:30

    This optional lesson teaches how to use a repeating NSTimer or SKAction (in the Sprite Kit project) to fade in a tinted background behind the Options Class. We'll do this using a UIView with the backgroundColor set to black, and changing the alpha value over time.

Requirements

  • Mac with Xcode 5 or higher

Description

In this tutorial, we will focus entirely on creating an Options or Preferences screen, using a Single View Application (or UIView based project) or Sprite Kit based project. We'll create UISwitches, UIButtons, UISliders, UISegmentedControls (and groups of buttons that act like segmented controls), and finally, a UIPickerView. Picker views can be made up of single or multiple columns of "spin-able" data (for example, Apple's Clock app has a Timer function made up of a double column UIPickerView).

In our hypothetical project we will create a 3-column picker view which populates itself using data from a Property List file. This data is split into a column for the level name ("Ocean, Bad Lands, etc"), a column for the mode of game play ("Kill X" number of enemies, "Collect X" number of coins, or "Beat the Clock") and third column for a number parameter to tweak the difficulty of each game mode (for example, you could add more time to the "Beat the Clock" mode or add more enemies to kill). We will make the wheels interconnected as well. So if you spin the first wheel to set the level, it will change the other two wheels to default to the settings defined in the Property List for the level. If you spin the middle wheel to change the game mode, it will automatically change the third wheel to use a different range of numbers (one mode of play might be best with a small range like 1-15, but another might work better in increments of ten, like 60-300).

All of our data is stored in a singleton AppData class, which serves as a go-between to use (or test) our preference variables with any other class. You'll see how to test any changes made in the OptionScreen class with the main game / app class.

The source projects are saved in increments throughout the tutorial series, and uploaded in the Supplemental Materials tab at notable breakpoints. You'll get both UIView and Sprite Kit based projects. The images to use are included as well.

Who this course is for:

  • Anyone already developing an iOS app or planning to.