본문 바로가기
  • Naked Code
알롬버스/스터디 문제 모음

[🍎IOS]3주차 알롬버스 SwiftUI 문제

by bobmyeonsoo 2023. 7. 23.

Q1. SwiftUI를 만들때 view layout을 선언하는 부분?

a.body()

b. layoutSubViews()

c.alignment()


Q2. 다음 코드를 통해 구현될 화면은?

var body: some View {
    HStack {
        CircleImage()
        VStack(alignment: .leading) {
            Text("Turtle Rock")
                .font(.title)
            Text("Joshua Tree National Park")
        }
    }
}

a.

b.

c.


Q3. 3가지 view를 하나로 보이게 하는 코드를 고르시오.

a.

VStack {
   Text("Turtle Rock")
      .font(.title)
   Divider()
   Text("Joshua Tree National Park")
}

b.

[
    Text("Turtle Rock").font(.title),
    Divider(),
    Text("Joshua Tree National Park")
]

c.

Text("Turtle Rock")
    + Divider()
    + Text("Joshua Tree National Park")

Q4. 다음 중 text 를 customize하기 위한 코드인 것은?

a.

var text = Text("Hello world!")
text.font(.title)
text.foregroundColor(.purple)
return text

b.

var text = Text("Hello world!")
text.font = .title
text.foregroundColor = .purple
return text

c.

Text("Hello world!")
   .font(.title)
   .foregroundColor(.purple)