5. Making a Game

Now that we’ve covered user input, events, and data structures in Swift, you’re ready to put the concepts into action. In this chapter you’ll make a tic-tac-toe game featuring tappable buttons and artificial intelligence (AI). To develop and run it as an iOS app, you’ll set up a full-fledged project in Xcode. The IDE makes it easy to add pictures to the game, build a user interface, and respond to player events. If you’ve built iOS apps in the past, some of the Xcode information in this chapter may be a recap for you. When we move on to the actual game logic, you’ll notice a departure from Objective-C. Swift features like type inference really start to shine as you get into bigger and more complex apps.

Get Learning Swift™ Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.