iOS Programming: The Big Nerd Ranch Guide (5th Edition) (Big Nerd Ranch Guides)

iOS Programming: The Big Nerd Ranch Guide (5th Edition) (Big Nerd Ranch Guides)

Christian Keur, Aaron Hillegass

Language: English

Pages: 416

ISBN: 0134390733

Format: PDF / Kindle (mobi) / ePub


iOS Programming: The Big Nerd Ranch Guide leads you through the essential concepts, tools, and techniques for developing iOS applications. After completing this book, you will have the know-how and the confidence you need to tackle iOS projects of your own. Based on Big Nerd Ranch's popular iOS Bootcamp course and its well-tested materials and methodology, this bestselling guide teaches iOS concepts and coding in tandem. The result is instruction that is relevant and useful.

 

Throughout the book, the authors explain what's important and share their insights into the larger context of the iOS platform. You get a real understanding of how iOS development works, the many features that are available, and when and where to apply what you've learned.

The End of Poverty: Economic Possibilities for Our Time

Jump Start CSS

Environment and Development in the Straits of Malacca (Routledge Studies in Development and Society)

The Agrarian Question in the Neoliberal Era: Primitive Accumulation and the Peasantry

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

When a UIButton is tapped, it calls a method on another object. That object is called the target. The method that is triggered is called the action. This action is the name of the method that contains the code to be executed in response to the button being tapped. In your application, the target for both buttons will be the instance of ViewController. Each button will have its own action. Let’s start by defining the two action methods: showNextQuestion(_:) and showAnswer(_:).

r​e​a​d​i​n​g​2​ ​=​ ​9​.​2​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​9​.​2​ r​e​a​d​i​n​g​3​ ​=​ ​9​.​7​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​9​.​7​ However, you cannot use these optional floats like non-optional floats – even if they have been assigned Float values. Before you can read the value of an optional variable, you

l​e​t​ ​s​e​c​o​n​d​F​r​a​m​e​ ​=​ ​C​G​R​e​c​t​(​x​:​ ​2​0​,​ ​y​:​ ​3​0​,​ ​w​i​d​t​h​:​ ​5​0​,​ ​h​e​i​g​h​t​:​ ​5​0​)​ ​ ​ ​ ​l​e​t​ ​s​e​c​o​n​d​V​i​e​w​ ​=​ ​U​I​V​i​e​w​(​f​r​a​m​e​:​ ​s​e​c​o​n​d​F​r​a​m​e​)​ ​ ​ ​ ​s​e​c​o​n​d​V​i​e​w​.​b​a​c​k​g​r​o​u​n​d​C​o​l​o​r​ ​=​ ​U​I​C​o​l​o​r​.​g​r​e​e​n​C​o​l​o​r​(​)​ ​ ​ ​ ​v​i​e​w​.​a​d​d​S​u​b​v​i​e​w​(​s​e​c​o​n​d​V​i​e​w​)​ }​ Build and run again. In addition to the blue rectangle, you will see a green square near the

s​e​c​o​n​d​V​i​e​w​.​b​a​c​k​g​r​o​u​n​d​C​o​l​o​r​ ​=​ ​U​I​C​o​l​o​r​.​g​r​e​e​n​C​o​l​o​r​(​)​ ​ ​ ​ ​f​i​r​s​t​V​i​e​w​.​a​d​d​S​u​b​v​i​e​w​(​s​e​c​o​n​d​V​i​e​w​)​ }​ Now let’s add some views to the interface and set their frames. Open Main.storyboard. Notice that the interface on the screen is currently a square. While you explore views and their frames, it will be nice to have the size of the interface in Xcode match the screen size of the device that you will be using.

storyboard file, and you need a way of triggering the dismissKeyboard(_:) method you added. To take care of the first item, open Main.storyboard and select the Conversion View Controller. Control-drag from the Conversion View Controller to the text field on the canvas and connect it to the textField outlet. Now you need a way of triggering the method you implemented. You will use a gesture recognizer to accomplish this.

Download sample

Download