Dunfey · Hotel WWDC as data, est. 1983
Front desk everything
Years
Topics

2022 Business & EducationDeveloper ToolsEssentialsHealth & FitnessSwift

WWDC22 · 16 min · Business & Education / Developer Tools / Essentials / Health & Fitness / Swift

Build your first app in Swift Playgrounds

Learn how you can easily prototype and build apps with Swift Playgrounds. We’ll show you how to create an app from a blank project, build its interface with SwiftUI, and use Swift Package Manager to add extra functionality from an open source package. We’ll also explore how you can debug issues using Previews and the console and take you through submitting an app to App Store Connect for distribution via TestFlight.

Watch at developer.apple.com ↗

Transcript all transcripts

Code shown on screen · 8 snippets

First Tea Item swift · at 3:31 ↗
Text("Jasmine Green")
List Of Teas swift · at 3:39 ↗
Text("Jasmine Green")
Text("English Breakfast")
Text("Byte's Oolong")
Text("Golden Tippy Assam")
Text("Matt P's Tea Party")
Text("Darjeeling")
Text("Genmaicha")
Text("Jasmine Green")
Text("Vanilla Rooibos")
OrderedSet of Teas swift · at 4:45 ↗
let teas: OrderedSet<String> = ["Byte's Oolong", "Golden Tippy Assam", "English Breakfast", "Matt P's Tea Party", "Darjeeling", "Genmaicha", "Jasmine Green", "Vanilla Rooibos"]
ForEach View swift · at 5:28 ↗
ForEach(teas, id: \.self) { tea in
     Text(tea)
}
Initial Preview Provider swift · at 8:45 ↗
struct TeaWheelView_Previews: PreviewProvider {
    static let items: [String] = ["Item 1", "Item 2", "Item 3", "Item 4", "Item 5"]
    static var previews: some View {
        Text("Hello, world!")
    }
}
Preview Provider with TeaWheelView swift · at 9:22 ↗
struct TeaWheelView_Previews: PreviewProvider {
    static let items: [String] = ["Item 1", "Item 2", "Item 3", "Item 4", "Item 5"]
    static var previews: some View {
        TeaWheelView(items, id: \.self)
            .padding()
    }
}
TeaWheelView in Assistant Tab swift · at 10:40 ↗
TeaWheelView(dataSource.teas, action: { tea in
    lastPickedTea = tea
    showPickAlert = true
})
Preview Provider with Print Statement swift · at 11:55 ↗
struct TeaWheelView_Previews: PreviewProvider {
    static let items: [String] = ["Item 1", "Item 2", "Item 3", "Item 4", "Item 5"]
    static var previews: some View {
        TeaWheelView(items, id: \.self) {
            print($0)
        }
            .padding()
    }
}