Hello Swift!
iOS app programming for kids and other beginners
Tanmay Bakshi
  • April 2019
  • ISBN 9781617292620
  • 400 pages
  • printed in black & white

A wonderful and rare opportunity for young programmers to learn from a peer. A great introduction to iOS development for readers of any age.

Jason Pike, Atlas RFID Solutions

Hello Swift! is a how-to guide to programming iOS Apps with the Swift language, written from a kid's perspective. This approachable, well-illustrated, step-by-step guide takes you from beginning programming concepts all the way through developing complete apps. (Adults will like it too!)

Table of Contents detailed table of contents

1 Get ready to build apps with Swift!

1.1 Your “I can do it!” journey begins

1.1.1 What is an app, anyway?

1.1.2 The pieces of a good app

1.1.3 What is programming?

1.1.4 From idea to app

1.2 What is Swift?

1.2.1 What’s so special about Swift?

1.2.2 Swift can’t do everything

1.3 Prepping your app toolbox

1.3.1 Gather hardware

1.3.2 Install Xcode

1.3.3 Setup Optional Developer Account

1.3.4 Start XCode for the first time

1.4 Write code and see it work in the Swift Playground

1.4.1 What Is the Playground?

1.4.2 Create a Playground

1.4.3 Play with code in the Playground

1.5 Check your app knowledge!

2 Create your first app

2.1 Hello Apps!

2.2 Your first app: Hello World!

2.2.1 What does this app do?

2.2.2 Set up the project

2.2.3 The Xcode interface

2.2.4 Create the UI

2.2.5 Run your app

2.3 Discover the user interface

2.3.1 What is a UI?

2.3.2 Develop an app on your own

2.3.3 Change text colors

2.3.4 Change the background color of a control

2.3.5 Change the background color of a view

2.3.6 More about controls: Try these for a challenge

2.3.7 A few more things you can do with the Attributes inspector

2.3.8 Segues: Using controls to navigate screens

2.3.9 Try an extra challenge

2.4 Designing good UIs

2.5 Try this app on your own

2.6 Test your app knowledge

3 Your first real Swift code using variables

3.1 Apps store data in variables

3.1.1 What is a variable?

3.1.2 Hands on!

3.1.3 How does an app use and save variables?

3.1.4 What types of variables are there?

3.1.5 How to create variables

3.1.6 Hands on!

3.2 Declaring variables and changing values

3.2.1 Declaring variables

3.2.2 Changing variable values

3.2.3 Hands on! Spying on data

3.2.4 Using \ and () to format text

3.3 Transforming your data

3.3.1 Concatenating data

3.3.2 Hands on!

3.3.3 Test these rules

3.3.4 Converting data

3.4 Math Operation Theater

3.4.1 What is an Operation?

3.4.2 Do basic Math with Swift (+, -, *, /)

3.4.3 So I can only do math in a print() function?

3.4.4 Step up in math with Swift (square root, power, modulus)

3.4.5 Hands on!

3.4.6 Advanced math in the playground

3.5 Check your app knowledge

4 I/O laboratory

4.1 How apps and users interact

4.2 How do users get output?

4.2.1 Start with Hello World

4.2.2 Add a variable to hold the label

4.2.3 Connect your label variable to a label on the view

4.2.4 The Interface Builder

4.3 Users give apps input

4.3.1 Add a text field and button to the app

4.3.2 Add code to connect the text field to code

4.3.3 Add the function to change the label text to input text

4.4 Check your app knowledge

4.5 App-Activity: Concatenate

4.5.1 What does this app do?

4.5.2 Create the UI

4.5.3 Code the app

4.6 App-Exercise: Greeting Generator

4.6.1 What does this app do?

4.6.2 Create the UI

4.6.3 Code the app

4.6.4 Run the app

5 Computers make decisions, too!

5.1 Conditions with the if statement

5.1.1 if this is true, then do something

5.2 App: Which Number is Bigger?

5.2.1 What does this app do?

5.2.2 Set up the project

5.2.3 Create the UI

5.2.4 Code the app

5.2.5 Connect IBOutlets to Controls and IBActions to Buttons

5.2.6 Learn How the Code Works

5.2.7 Run the App

5.2.8 Run the app again!

5.2.9 Run the code, again!

5.2.10 Recapping the If, Else, and Else If statement

5.3 switch statements

5.4 App: The Mystery of the Entered Number

5.4.1 What does this App do?

5.4.2 Create the UI

5.4.3 Code the app

5.4.4 Run the App

5.5 Check your app knowledge

5.6 App-Exercise: Gold, Silver, Bronze

5.6.1 What does this app do?

5.6.2 Set up the project

5.6.3 Create the UI

5.6.4 Code the app

5.6.5 Run your app

5.7 App-Exercise: tTables the Times Tables Bee!

5.7.1 What does this app do?

5.7.2 Set up the project and create the UI

5.7.3 Code the app

5.7.4 Learn How the Code Works

5.7.5 Run Your App!

6 Let computers do repetitive work

6.1 Controlling repetition

6.2 for-in loop statements

6.2.1 Try it Yourself

6.2.2 How does it work?

6.2.3 Playground Example

6.3 while loop statements

6.3.1 Try it yourself

6.3.2 The Not Equal To (!=) Operator

6.3.3 Playground example

6.3.4 The repeat while loop

6.3.5 Playground Exercise: Repeat While

6.4 APP: How Many Times?

6.4.1 What does this app do?

6.4.2 Set Up the Project and Create the UI

6.4.3 Code the app

6.4.4 Run Your App

6.5 Check your app knowledge

6.6 App-Exercise: Hang your Word Upside-Down!

6.6.1 What does this app do?

6.6.2 Explanation, Playground Exercise and including the helper code

6.6.3 Set Up the Project and Create the UI

6.6.4 Code the app

6.6.5 Run your app

7 Knitting variables into arrays and dictionaries

7.1 Why do we need arrays and dictionaries?

7.2 What is an array?

7.2.1 Arrays start counting with 0!

7.2.2 Getting to your data

7.2.3 Altering the Array

7.2.4 Looping Through Arrays

7.3 10 Number Sorter app

7.3.1 What does this app do?

7.3.2 Set up the project and create the UI

7.3.3 Code the app

7.3.4 Learn how the code works

7.3.5 Run your app

7.4 Go to the second dimension (rows and columns)

7.5 What is a dictionary?

7.5.1 Turning a dictionary into code

7.5.2 Creating a dictionary and getting to your data

7.5.3 Changing the dictionary

7.5.4 Looping through data in dictionaries

7.6 Friend List app

7.6.1 What does this app do?

7.6.2 Set up the app, and create the UI

7.6.3 Code the app

7.7 Check your app knowledge

7.8 App-Exercise: Alphabet Unscrambler

7.8.1 What does this app do?

7.8.2 Set up the project and Create a UI

7.8.3 Code the app

7.8.4 Learn how the code works

7.8.5 Run the app

8 Reuse your code: Clean it with function detergent

8.1 Reuse and clean your code with functions

8.1.1 Simple functions

8.2 Giving info to your reusable code

8.2.1 Try it for yourself.

8.3 Getting info from your reusable code

8.4 Check your app knowledge

8.5 App-Exercise: Virtual Dice

8.5.1 What does this app do?

8.5.2 Set up the project and create the UI

8.5.3 Code the app

8.5.4 Learn how the code works

8.5.5 Run your app

8.6 App-Exercise: Rock Paper Scissors!

8.6.1 What does this app do?

8.6.2 Set up the project and create the UI

8.6.3 Code the app

8.6.4 Connect the IBOutlets and IBActions

8.6.5 Learn how the code works

8.6.6 Run your app

8.7 App-Exercise: Money Denomination

8.7.1 What does this app do?

8.7.2 How does this app work?

8.7.3 Set up the project and create the UI

8.7.4 Codethe App

8.7.5 ConnectIBOutlets and IBActions

8.7.6 Run the app

9 Reduce your code: Use less, do more with class detergent

9.1 Reduce and clean your code with classes

9.1.1 What is a class?

9.1.2 Why you should learn to use classes

9.1.3 Have some fun with classes

9.1.4 How do classes reduce code?

9.2 Create a class

9.2.1 Add a variable

9.2.2 Create Instances of your class

9.2.3 Change the value of a variable

9.2.4 Adding Functionality to Classes

9.2.5 Quick review

9.2.6 Add an initializer that does something every time you create an instance

9.3 Like father, like son: Inheritance!

9.4 All about scope

9.4.1 What is variable’s scope?

9.5 Calculator app

9.5.1 What does this app do?

9.5.2 Create the UI

9.5.3 How does this app work?

9.5.4 Code the app

9.5.5 Connect IBOutlets and IBActions

9.5.6 Run the app

9.6 Check your app knowledge

9.7 App-Exercise: Metric Conversion!

9.7.1 What does this app do?

9.7.2 Math: Negative powers

9.7.3 Creating the UI

9.7.4 Code the app

9.7.5 Connect IBOutlets and IBActions

9.7.6 Run your app

9.8 Extra app-exercise: Metric Conversion app, Part 2

9.8.1 What does this app do?

9.8.2 Code the app

9.8.3 Run the app

10 Reading and Writing Files

10.1 What is in a file?

10.1.1 What is File Content Managing?

10.2 File Content Manager app

10.2.1 What does this app do?

10.2.2 Set up the project and create the UI

10.2.3 Code the app

10.2.4 Learn how the code works

10.2.5 Run your app

10.3 Hangman app

10.3.1 What does this app do?

10.3.2 Setup the project and create the UI

10.3.3 Code the app

10.3.4 Connect the Variables, IBOutlets, and IBActions

10.3.5 Run the app

10.4 Check your app knowledge

10.5 App-Activity: Store your name and birth date

11 Frameworks: Bookshelves of classes

11.1 What is a framework?

11.2 Create a framework

11.2.1 What does this app do?

11.2.2 Create the project

11.2.3 Code the app

11.2.4 Learn how the code works

11.2.5 Build the framework

11.2.6 Use the framework

11.3 App: Load Save, Part 2, using frameworks

11.3.1 What will we do to this app?

11.3.2 Removing the read and write functions

11.3.3 Creating the framework reference in Xcode

11.3.4 Coding the framework in the LoadSave app

11.3.5 Run your app

11.4 Check your app knowledge

12 SpriteKit: Fun animation time

12.1 Meet SpriteKit

12.2 How does SpriteKit work?

12.2.1 Pixels

12.2.2 Coordinate System

12.3 Drag the Square (DTS) app

12.3.1 What does this app do?

12.3.2 Create the project

12.3.3 Code the app

12.3.4 Run the app

12.4 A Christmas Tree app to try on your own

12.5 Check your app knowledge

13 Time to watch your WatchKit code

13.1 Number Guessing Game app

13.1.1 What does this app do?

13.1.2 Create the UI

13.1.3 Coding the application

13.1.4 Run your application

13.2 Check your app knowledge

14 Continuing your journey with Swift

14.1 Resources

14.1.1 liveBook Discussion Forum

14.1.2 Stack Overflow

14.1.3 GitHub

14.1.4 YouTube and Books

14.2 What’s next?

Appendixes: Preface

Appendix A: Check if I am Prime!

A.1 What does this app do?

A.2 Setup the project and create the UI

A.3 Code the app

A.3.1 Create IBOutlets and IBActions

A.4 Run your app

Appendix B: Mean Median Detective

B.1 What does this app do?

B.2 Setup the project and create the UI

B.3 Code the app

B.4 Create the IBOutlets, functions, and IBActions

B.5 Extra challenge

Appendix C: Factoring Factory

C.1 What does this app do?

C.2 Setup the project and create the UI

C.3 Code the app

C.3.1 Create IBOutlets and IBActions

Appendix D: How Big Is a Triangle?

D.1 What does this app do?

D.2 Setup the project and create the UI

D.3 Code the app

D.3.1 Add the IBOutlets and IBAction

D.3.2 Learn how the code works

Appendix E: I’m mixed up, make me improper!

E.1 What does this app do?

E.2 Set up the project and create the UI

E.3 Learn how this code works

E.4 Code the app

E.4.1 Create the IBOutlets, functions, and IBActions

Appendix F: Installation

About the Technology

It’s fun to play games and explore new things on your iPhone. How amazing would it be to create your own apps? With a little practice, you can! Apple’s Swift language, along with special coding playgrounds and an easy-to-use programming environment, make it easier than ever. Take it from author Tanmay Bakshi, who started programming when he was just five years old.

About the book

His book, Hello Swift! iOS app programming for kids and other beginners, teaches you how to write apps for iPhones and iOS devices step by step, starting with your first line of Swift code. Packed with dozens of apps and special exercises, the book will teach you how to program by writing games, solving puzzles, and exploring what your iPhone can do. Hello Swift! gets you started. Where you go next is up to you!

What's inside

  • Crystal-clear explanations anyone can understand
  • Kid-friendly examples, including games and puzzles
  • Learn by doing—you’ll build dozens of small apps
  • Exercises that encourage critical thinking

About the reader

Written for kids who want to learn how to program. (Psst! Adults like it, too.)

About the author

Tanmay Bakshi had his first app on the iOS App Store at the age of nine. He’s now the youngest IBM Champion, a Cloud Advisor, Watson Developer, TED Speaker, and Manning author!


combo $34.99 pBook + eBook + liveBook
eBook $27.99 pdf + ePub + kindle + liveBook
Prices displayed in rupees will be charged in USD when you check out.

placing your order...

Don't refresh or navigate away from the page.

FREE domestic shipping on three or more pBooks