Skip to main content

SwiftUI

  • Declarative Framework made with Swift

SwiftUI Overview - Xcode - Apple Developer

  • SwiftUI App์€ App Protocol์„ ์ค€์ˆ˜.
  • Structure์˜ Body๋Š” 1๊ฐœ ํ˜น์€ ๋” ๋งŽ์€ Scene์„ Return.
  • @main์œผ๋กœ ์ง„์ž…์ ์„ ํ‘œ์‹œ.
  • ํ™•์‹คํžˆ declarativeํ•˜๋‹ˆ๊นŒ ํŽธํ•˜๋‹ค

์•„๋ž˜์™€ ๊ฐ™์ด ์‹œ์ž‘ ๊ฐ€๋Šฅ

import SwiftUI

struct LandmarkDetail: View {
var body: some View {
Text("Hello, World!")
}
}

struct LandmarkDetail_Previews: PreviewProvider {
static var previews: some View {
LandmarkDetail()
}
}

์•„๋ž˜์™€ ๊ฐ™์ด Frame ๊ฐ€๋Šฅ.

struct LandmarkRow_Previews: PreviewProvider {
static var previews: some View {
Group {
LandmarkRow(landmark: landmarks[0])
LandmarkRow(landmark: landmarks[1])
}.previewLayout(.fixed(width: 300, height: 70))
}
}

Text()์— ๋Œ€ํ•ด ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋””์ž์ธ ๊ฐ€๋Šฅ.

Text("Turtle Rock").font(.title)
๐Ÿ’ฌWork in Progress

Work in Progress. Check back later.