i've done read this tutorial and it is good tutorial for covering basic storyboard, so i try to rewrite it to make me understand the lesson more.
This is the steps:
This is the steps:
- Open Xcode, file-new project, select single view application
- Type project name, check Use Storyboard and Use Reference Counting
- on the Left, in Project Navigator, click MainStoryboard_iPhone
- now change the background to green and add a label and a button, to do this follow this step
- To change background, in middle of screen there is a area that contain a box labeled View Controller Scene, this area is called Document Outline Area and the box si called Object Scene.
- Uncollapse View Controller in View Controller Scene by clicking the white triangle
- Click View, on right area you should see a View properties, change the background to green
- To add a label, you should see on bottom right there is scrollbox with many items, this is Object Libraries that we can use it in our View
- Scroll it down, find a Label, drag it to the View, change the string in it to "Green" by double click it
- Again, in the Object Libraries find a Button, it is below a Label, drag it to View, change the string to "Turn Red" by double click it
- now you have one view, to add another, on the Object Libraries find View Controller
- drag it to empty area, and you have another one,
- change the second view background to red, you should can do it
- add the label, change the string to "Red"
- add the button, change the string to "Turn Green"
- now you have two view, next we will create segue, to allow it change view when the button is pressed
- select the "Turn Red" button,
- Control Click and drag to the Red view
- when a dialog appear, select modal
- now you can test it on simulator, when you click the "turn red" button the view will change to Red
- but, when you click "turn green"button , nothing happened, because we are not already create the segue for that button
- now, Control Click "Turn Green" button, drag to Greens View, release it. when a dialog appear, click modal
- test it, now when you click the "Turn Green" button the Green View appear,
- to change the view transition animation, click the "Segue from UIButton to View Controller" in the Scene Object box in Document Outline Area, or click the line that created when you done create a segue
- on the left there is properties of transition, i choose "Cross disolve"
- Finish, try it on simulator