This repo contains SwiftUI code which showcases View components like List
, AsyncImage
, Property Wrappers like @Binding and much more SwiftyUI snacks. I've also created a few sample SwiftUI apps which you will find below. Text("Enjoy!")
Throughout this repo you'll come across "try? it out" code snippets, copy, paste into a SwiftUI ContentView
or similar test View.
- What data does the view need?
- How will it use that data?
- Where does the data come from?
Questions from Data Essentials in SwiftUI - WWDC20
try? it out
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
Image("swiftui-logo")
Text("SwiftUI")
.foregroundColor(.white)
.font(.largeTitle)
.bold()
.padding(.bottom, 20)
Text("SwiftUI helps you build great-looking apps across all Apple platforms with the power of Swift — and surprisingly little code. You can bring even better experiences to everyone, on any Apple device, using just one set of tools and APIs.")
.multilineTextAlignment(.center)
.foregroundColor(.white)
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(.black)
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
2022
2021
2020
- Apple: SwiftUI
- Apple: SwiftUI Videos
- Apple SwiftUI Tutorials
- Apple SwiftUI Concepts
- Apple Sample Code: Introducting SwiftUI
- Apple Sample Code: Exploring SwiftUI Sample Apps
- Apple Sample Code: Food Truck: Building a SwiftUI multiplatform app
- Apple Sample Code: Fruta: Building a Feature-Rich App with SwiftUI
- Apple Sample Code: Create Accessible Views and more sample code