Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
iOS 13 Programming for Beginners

You're reading from   iOS 13 Programming for Beginners Get started with building iOS apps with Swift 5 and Xcode 11

Arrow left icon
Product type Paperback
Published in Jan 2020
Publisher Packt
ISBN-13 9781838821906
Length 822 pages
Edition 4th Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Craig Clayton Craig Clayton
Author Profile Icon Craig Clayton
Craig Clayton
Ahmad Sahar Ahmad Sahar
Author Profile Icon Ahmad Sahar
Ahmad Sahar
Arrow right icon
View More author details
Toc

Table of Contents (33) Chapters Close

Preface 1. Section 1: Swift
2. Getting Familiar with Xcode FREE CHAPTER 3. Simple Values and Types 4. Conditionals and Optionals 5. Range Operators and Loops 6. Collection Types 7. Functions and Closures 8. Classes, Structures, and Enumerations 9. Protocols, Extensions, and Error Handling 10. Section 2: Design
11. Setting Up the Basic Structure 12. Building Your App Structure in Storyboard 13. Finishing Up Your App Structure in Storyboard 14. Modifying and Configuring Cells 15. Section 3: Code
16. Getting Started with MVC and Collection Views 17. Getting Data into Collection Views 18. Getting Started with Table Views 19. Getting Started with MapKit 20. Getting Started with JSON Files 21. Displaying Data in a Static Table View 22. Getting Started with Custom UIControls 23. Getting Started with Cameras and Photo Libraries 24. Understanding Core Data 25. Saving and Loading from Core Data 26. Section 4: Features
27. Getting Started with Dark Mode 28. Getting Started with Mac Catalyst 29. Getting Started with SwiftUI 30. Getting Started with Sign In with Apple 31. Testing and Submitting Your App to the App Store 32. Other Books You May Enjoy

Running the app in the Simulator

The Simulator gives you an idea of how your app would look and behave if it were running on a device. It can model a number of different types of hardware—all the screen sizes and resolutions for both iPad and iPhone—so you can simulate your app on every device you're developing for.

To run the app in the Simulator, perform the following steps:

  1. Click the Scheme menu in the toolbar and you will see a list of Simulators. Choose iPhone 11 from this menu:
  1. Click the Play button to install and run your app on the currently selected Simulator. You can also use the command + R keyboard shortcut.
  2. If you see the Developer Tools Access dialog box, enter the Mac's admin Username and Password and click Continue:

  1. The Simulator app will launch and show a representation of an iPhone 11. Your app displays a white screen, as you have not yet added anything to your project:
  1. Switch back to Xcode and click on the Stop button (or type Command - .) to stop the currently running project.

You have just created and run your first iOS app in the Simulator! Great job!

If you look at the Scheme menu, you may be wondering about what the No Device and Build Only Device menu items are for. Let's take a look at them.

Understanding the No Device and Build Only Device menu items

You learned how to choose a Simulator in the Scheme menu to run your app in the previous section. But what are the No Device and Build Only Device menu items for? Well, Xcode not only allows you to run apps on the Simulator, but it also allows you to run apps on actual iOS devices, and prepare apps for submission to the App Store.

By clicking the Scheme menu in the toolbar, you will see the entire menu, and at the top of the menu are the No Device and Build Only Device sections:

The No Device section currently displays text stating No devices connected to 'My Mac'... because you currently don't have any iOS devices connected to your computer. If you were to plug in an iOS device, it would appear in this section, and you would be able to run the apps you develop on it for testing. Running your apps on an actual device is recommended as the Simulator will not accurately reflect the performance characteristics of an actual iOS device, and does not have some hardware features and software APIs that actual devices have.

The Build Only Device section has only one option, Generic iOS Device. This is used when you need to archive your app prior to submitting it to the App Store. You'll learn how to do this in the last chapter of this book.

Now let's see how to build and run your app on an actual iOS 13 device. The vast majority of the instructions in this book do not require you to have an iOS device though, so if you don't have one, skip the next section and go straight to Chapter 2, Simple Values and Types.

You have been reading a chapter from
iOS 13 Programming for Beginners - Fourth Edition
Published in: Jan 2020
Publisher: Packt
ISBN-13: 9781838821906
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime