This may be a stupid question, but...
It was really easy in UIKit, but it's even easier with SwiftUI.
Wait an hour for it to download
Open Xcode and the Welcome Screen will pop up. Click "Create a new Xcode project"
Choose "Single View App"
Enter the "Product Name" (name of your app). For "Organization Name", enter your name. For "Organization Identifier", it's formatted in reverse domain name notation, which is basically "com" followed by your domain name, and then your product name. It's ok if you don't own a domain, just make one up. Example: com.myfirstappdomain.FirstApp. Also, make sure "SwiftUI" is selected for the User Interface.
Press "Next" and choose the location where you want to save your app. Don't worry about Source Control for now.
Press "Create"!
Code Block language /* // ContentView.swift // FirstApp // // Created by Your Name on 6/19/20. // Copyright © 2020 Your Name. All rights reserved. */ import SwiftUI struct ContentView: View { var body: some View { Text("Hello, World!") } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
Here's the above code explained:
First, you import SwiftUI, which loads the framework. SwiftUI lets you make apps by writing out what you want to see.
To write out the user interface, your code goes in a struct, which is building block that you can add properties and store values in. body is a property, and inside is a Text object (which comes from SwiftUI). What the code says is, Here's a struct that contains some text that says "Hello World!"
In our case, we want to see "Hello World!" (no comma) so you can remove the comma that Xcode auto-generated. Or you can keep it if you want 😁.
Underneath all the code is another struct, ContentView_Previews. This is for Xcode to know what you want to display in the live preview. You don't need to worry about this.
Now all that's left is to run the app! In the upper-left corner of the screen, first make sure you select an iOS device to simulate on (<Your App's Name> → iPhone 8). Then, press Command + r to run! You may be asked to sign in to your Apple ID, and if there's any errors, try signing in.
A simulated device will appear on your screen after a while, and it says, "Hello World"! Here's a screenshot. That's it! Your first app!
To get more advanced, you can make use of resources on the internet. Hacking With Swift and Ray Wenderlich are both free resources that are great places to start (search them on Google, I couldn't put the links because they weren't allowed on the Forums). You can also go on Udemy and buy a course, like what I did (usually around $10) -- I would recommend following more tutorials before you start making your own apps (it'll be much easier once you know the basics). And if you're ever stuck, you can post questions on Stack Overflow, or do what you just did, ask on the Forums!
Happy coding!
My advice is to search online for simple app tutorials which Interest you and follow them to learn. As you grow, take apart open sourced Xcode projects to see how they work.
if you have an iPad, Swift Playgrounds is an excellent way to learn the Swift language.
Above all, keep safe...
Download the app on your iPhone
Find "Developing iOS 11 Apps with Swift"
Add it to your courses
P.S. sorry for possible mistakes. I'm not a native speaker = )
Stanford CS193p - Lecture 1: Course Logistics and Introduction to SwiftUI
Professor Paul Hegarty is a legend and has been teaching this specific course for a decade.
Hacking With Swift by Paul Hudson
Ray Wenderlich Tutorials
If you are just starting, I suggest you avoid all the betas. Stick with the stable version of Xcode and don't worry if you see a million buttons and settings. You will learn them over time.
Find a mentor, be humble and remain enthusiastic.
Welcome to the family!
Even so, I’d recommend SwiftUI since it’s not too difficult to use UIKit views in places where SwiftUI has no support yet.
Good luck with your journey!
However, books aren't for everyone, and a video course may be a better place to start (you can follow step by step easier). Books can also be expensive, as they average around $50.
« Intro to App Development with Swift »
Instead, I would recommend taking a look at https://developer.apple.com/tutorials/swiftui/tutorials, as mentioned by Zorro earlier.
I'm also a beginner developer like you.
Learn Swift and create wonders...