INTRODUCTION

Have you ever heard someone say, “I wish there was an app for that?” Maybe they were talking about a holiday card organizer or an app that can turn someone into a kitten. Well, you can be the person who makes that app! In this book, you’ll learn how to program in Swift, the language used for mobile applications that run on all Apple devices. By the time you’ve finished reading, you’ll have developed apps you can run on your iPhone, iPad, or iPod touch.

If you’re new to programming, Swift is a great first programming language. It’s modern and powerful, yet fun and easy to learn. You can write Swift in Xcode’s playground, which lets you see the results of your code immediately. Once you have the basics down, you can go from using the playground to creating mobile apps in Xcode that you can carry everywhere—right in your pocket!

Learning a programming language will give you skills in problem solving, communication, and creativity. For these reasons and many more, programming is a highly useful skill to have. Even if you don’t intend to become a professional programmer, if you regularly use a computer or a mobile device, then learning to program can improve your life.

WHO SHOULD READ THIS BOOK?

If you’re interested in learning how to program, this book is a great place to start! Coding iPhone Apps for Kids is targeted toward kids, but it is also a good resource for adults who are new to programming. You should find this book useful whether you have no programming experience or are an experienced programmer who wants to learn how to develop apps.

If you’re new to programming, we recommend that you start at the beginning and then work your way forward, chapter by chapter, through Part 1: Xcode and Swift. These chapters teach you basic programming skills that will build upon each other. As you read, test out the examples and try writing your own code.

If you have some experience programming in another language, we recommend starting with Chapter 1, which shows you how to download and install Xcode and then walks you through creating a simple “Hello, world!” app. You may feel comfortable skimming through Chapters 2 to 4 and 6 to 8, but don’t skip Chapter 5. It covers optionals, which are an important programming feature that is unique to Swift.

WHAT’S IN THIS BOOK?

Chapter 1 covers installing Xcode on your computer and includes a simple tutorial to make a “Hello, world!” app that you can run on your iPhone, iPad, or iPod touch.

Chapter 2 delves into programming in an Xcode playground environment and shows you how to create variables and constants of different data types.

Chapters 3 and 4 teach you how to control the flow of a computer program. Chapter 3 covers if statements and conditionals, and Chapter 4 covers for-in and while loops.

Chapter 5 covers optionals, which are variables or constants that can either have a value or no value. Optionals are an important concept that’s unique to the Swift programming language, so be sure to read this chapter carefully.

In Chapter 6, you’ll learn how to work with two Swift collection types: arrays and dictionaries.

Chapter 7 covers writing functions, which are blocks of code that can be called repeatedly to perform specific tasks.

In Chapter 8, you’ll learn how to make a custom class, which is a blueprint for creating objects that represent real-world items, such as a backpack, a car, a cat, or anything else that you can imagine.

Part 2: Birthday Tracker includes Chapters 9 to 13. These five chapters walk you through creating an app that lets you save your friends’ birthdays on your phone and sends you reminders to wish them a happy birthday.

Part 3: Schoolhouse Skateboarder includes Chapters 14 to 18. These chapters walk you through the development of a game in which the player controls a skateboarder that jumps over cracks in the sidewalk and collects gems to increase their score.

Finally, the Resources provide information that will help you as you make your own apps, including tips for troubleshooting errors, where to find useful documentation, handy keyboard shortcuts, and information about Xcode versions.

THE COMPANION WEBSITE

Swift is an evolving language, and it gets updated often. We’ll keep track of those updates and how they affect this book on the book’s website (https://www.nostarch.com/iphoneappsforkids/). There, you can also find all the downloads for the examples we use.

HAVE FUN!

Programming is fun for so many reasons—you get to solve puzzles, impress people with your code creations, and feel pretty powerful once you know how to control a device. So, above all, don’t forget to have fun!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset