Working with object-oriented code in iOS apps

So far, we have created and extended classes in the Playground. In fact, we could execute the same sample code in the Swift REPL and the web-based Swift sandbox. Now, we will create a simple iOS app based on the Single View Application template with Xcode. We will recognize the usage of object-oriented code included in the template, that is, before we add components and code to the app. Then, we will take advantage of the GameRepository class we created in the previous chapter and use it to populate a UI element.

Tip

You will need Xcode 8 or greater in order to work with this example.

Navigate to File | New | Project... in Xcode. Click on iOS at the top of the Choose a template for your new project dialog ...

Get Swift 3 ObjectOriented Programming - Second Edition 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.