Book Image

iOS 13 Programming for Beginners - Fourth Edition

By : Ahmad Sahar, Craig Clayton
Book Image

iOS 13 Programming for Beginners - Fourth Edition

By: Ahmad Sahar, Craig Clayton

Overview of this book

iOS 13 comes with features ranging from Dark Mode and Catalyst through to SwiftUI and Sign In with Apple. If you're a beginner and are looking to experiment and work with these features to create your own apps, then this updated fourth edition gets you off to a strong start. The book offers a comprehensive introduction for programmers who are new to iOS, covering the entire process of learning the Swift language, writing your own apps, and publishing them on the App Store. This edition is updated and revised to cover the new iOS 13 features along with Xcode 11 and Swift 5. The book starts with an introduction to the Swift programming language, and how to accomplish common programming tasks with it. You'll then start building the user interface (UI) of a complete real-world app, using the latest version of Xcode, and also implement the code for views, view controllers, data managers, and other aspects of mobile apps. The book will then help you apply the latest iOS 13 features to existing apps, along with introducing you to SwiftUI, a new way to design UIs. Finally, the book will take you through setting up testers for your app, and what you need to do to publish your app on the App Store. By the end of this book, you'll be well versed with how to write and publish apps, and will be able to apply the skills you've gained to enhance your apps.
Table of Contents (33 chapters)
1
Section 1: Swift
10
Section 2: Design
15
Section 3: Code
26
Section 4: Features

Downloading and installing Xcode from the App Store

Before you begin writing iOS Apps, you need to download and install Xcode from the App Store. Perform the following steps:

  1. Open the App Store on your Mac (it's in the Apple menu).
  2. In the search field in the top-right corner, type Xcode and press the Return key.
  3. You should see Xcode in the search results. Click Get and click Install.
  1. If you have an Apple ID, type it in the Apple ID text box. If you don't have one, click the Create Apple ID button and follow the step-by-step instructions to create one:
You can see more information on how to create an Apple ID at this link:
https://support.apple.com/en-us/HT204316#appstore.
  1. Once Xcode has been installed, launch it. You should see the following Welcome to Xcode screen:

If this is the first time you have launched Xcode, you will see No Recent Projects in the right-hand panel. If you have previously created projects, then you will see them listed in the right-hand panel. Click Create a new Xcode project in the left-hand pane.

  1. You will see the new project screen as follows:

Across the top of this screen, you can select one of the following items: iOS, watchOS, tvOS, macOS, and Cross-platform. iOS should already be selected. Then, choose Single View App and click on Next.

  1. You will see an options screen for a new project:


This options screen has the following eight items to complete or choose:

  • Product Name: The name of your app. Enter ExploringXcode in the text field.
  • Team: The Developer Account Team for this project. Leave it as it is for now.
  • Organization Name: The name of your company. Just put your own name here for now.
  • Organization Identifier: Used in conjunction with the Product Name to create a unique identifier for your app on the App Store. Normally, reverse DNS notation is used. Enter com.myname for now.
  • Bundle Identifier: Automatically created by combining your Product Name and your Organization Identifier. Used to uniquely identify your app on the App Store.
  • Language: The programming language to be used. Set this to Swift.
  • User Interface: Set this to Storyboard.
  • Checkboxes: These checkboxes are used to include code for core data, unit tests, and UI tests. Leave them unchecked for now.

Click Next when you're done.

  1. Choose a location to save your project, such as the Desktop or Documents folder, and click Create:
  1. If you see a dialog box saying No author information was supplied by the version control system, click Fix.
The reason why you see this dialog box is because Source Control checkbox is ticked. Apple recommends that Source Control be turned on. To learn more about version control and Git, see this link: https://git-scm.com/video/what-is-version-control.
  1. You will see the Source Control preference screen as follows:

Enter the following information:

  • Author Name: Your own name
  • Author Email: Your email address
  1. The Xcode main window will appear.

Fantastic! You have now successfully downloaded and installed Xcode, and in the next section, we will study the Xcode user interface.