새소식

iOS/SwiftUI

[SwiftUI] 공식문서 파헤치기 (1) [SwiftUI]

  • -

SwiftUI


- User Interface와 모든 플랫폼에서의 동작을 선언합니다. 

 

- 앱의 UserInterface에서 정의할 때 View, Control 그리고 Layout을 제공

 

- Framework에서는 Tab, Gesture 그리고 다른 입력의 형태의 이벤트 Handler를 제공, 앱 Model에서 사용자들이 보고 상호 작용할 수 있는 데이터로부터 흐름을 관리하는 도구

 

- 앱 구조에서 사용하는 App 프로토콜을 정의하고 앱의 사용자 인터페이스로 구성된 뷰들이 포함되어 있는 Scene과 함께 채움

 

- View Protocol을 채택한 View를 생성하고 Stack, List 등을 사용하여 Text와 Image를 표시하기 위해 SwiftUI View를 구성

 

 

 

SwiftUI | Apple Developer Documentation

Declare the user interface and behavior for your app on every platform.

developer.apple.com

 

 

 

App 


- 앱에서 구조와 동작을 표현하는 타입

 

- App Protocol을 준수하여 앱을 만듦

 

- 필수적인 계산된 프로퍼티 body를 구현하여 앱의 콘텐츠를 만듦

@main
struct MyApp: App {
    var body: some Scene {
        WindowGroup {
            Text("Hello, world!")
        }
    }
}

 

 

 

App | Apple Developer Documentation

A type that represents the structure and behavior of an app.

developer.apple.com

 

 

 

 

Scene


- 앱의 일부를 구성하는 앱의 그룹을 선언

 

- System 관리와 App Life Cycle을 표현하는 일부분

 

- App에서 Scene을 나타내며, View는 Scene의 Root 요소

 

 

 

Scenes | Apple Developer Documentation

Declare the user interface groupings that make up the parts of your app.

developer.apple.com

 

728x90

'iOS > SwiftUI' 카테고리의 다른 글

[SwiftUI] 공식문서 파헤치기 (3) [Spacer / Divider]  (0) 2023.08.12
[SwiftUI] 공식문서 파헤치기 (2) [Stack]  (0) 2023.08.12
[SwiftUI] Stack  (0) 2023.01.30
[SwiftUI] Image  (0) 2023.01.14
[SwiftUI] Text  (0) 2023.01.07
Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.