<aside> đź’ˇ How to switch to dark mode

</aside>

📒 Workshop Description

Swift UI/Building an iOS Application: Swift is the Apple programming language that used to create applications on iOS, ipadOS, macOS, watchOS and tvOs. Anyone who has any creative ideas can use Swift to develop an app in a fairly easy way. In this workshop, learn how to program in Swift using the Swift Playground IDE, which you can download from the App Store. Anyone who participates in this workshop must have a MacBook or iPad, if you don't have one, still welcome!

🔖 Plans

Time Description
2 minutes introduction
13 minutes slides
40 minutes code demo
5 minutes Q & A
= 60 minutes

🎲 Preparing topics

SwiftUI fundamental view control

Text, Button, Image, Textfield, Picker…

// Text
// How to show a text on the screen
Text("Hello, world!")
	.foregroundStyle(.organge) // change the color of the text
	.font(.title)  // change the front with the tile text style

// Button
// How to add a button on the screen so the user can tap on it
// Method 1: Button(_ titleKey: LocalizedStringKey, action: () -> Void)
// Simple Text 
Button("Tap me") {
	print("I have been tapped")
}

// Method2: Button(action: () -> Void, label: () -> View)
// customizable function and button view 
Button(action: didTap, label: {
	Image(systemName: "sunrise.fill")
			.font(.system(size: 50))
			.foregreoundStyle(.red)
})

// Image
// How to show an image on the screen
// Method1: Image(systemName:)
// Need to check out the SF symbol or library to get the name of the image
Image(systemName: "person.badge.clock")
Image(systemName: "apple.logo")

// Method2: Image(_ resource:)
// This will work if there is an image in the assets of your app
Image("dog")