Starting an App in Swift
This post describes the simple procedures to start a minimalistic app in Swift.
Launch XCode, and select Create a new Xcode project.
Select Single View App in the view that follows, and click next.
Key in the Product Name and other information and click next. If Team is left as None, then this project cannot run on phones, but can only run on simulators.
On the upper left corner of the IDE, pick a simulator (e.g. iPhone 8 Plus), and click the play button to build and run. It might take some time to boot the simulator. As the app runs on the simulator, you will see a mostly white screen, and some log information at the bottom of the IDE.
That’s it! You’ve started a minimalistic app in Swift, and had it running on a simulator. the viewDidLoad()
in ViewController.swift is the first function that gets called. You may add print("view loaded.")
in this function, and see the message printed in the log.
You may follow this video to add buttons and let your app play music. To learn more about the Swift language, I recommend you watch this video and read its cheat sheet.
Happy coding!