SwiftUI/Essential

App Structure and Behavior 해석

garlic 2020. 12. 15. 10:00

 

App Structure and Behavior

Define the entry point and top-level organization of your app.

 

앱의 진입점과 최상위 구조를 정의하라


Overview

Declare your app by creating a structure that conforms to the App protocol and add one or more scenes to it. You can use built-in scenes, like WindowGroup, or you can compose custom scenes that conform to the Scene protocol. Scenes contain the view hierarchies that define the user interface of your app, and have a life cycle that the system manages.

 

해석 : App 프로토콜을 준수하는 구조체를 생성하여 앱을 선언하고 여기에 scene들을 추가하라. 당신은 WindowGroup과 같은 이미 존재하는 씬들을 사용할 수 있고, 혹은 Scene 프로토콜을 준수하는 커스텀 씬을 구성할 수도 있다. 씬들은 앱의 UI를 정의하고, 시스템을 관리하는 라이프 사이클을 가지고 있는 뷰 계층구조들을 포함한다.

 

 

Add menu commands to a scene by applying. CommandMenu instances. You can also update system-provided menus using a CommandGroup. When you provide keyboard shortcuts for commands, iOS, iPadOS, and tvOS make those available as key commands.

 

해석 : CommandMenu 인스턴스들을 적용하여 신에 메뉴 명령어를 추가하라. 또한 CommandGroup 을 사용하여 시스템이 제공하는 메뉴들을 업데이트 할 수도 있다. 만약 커멘드를 위한 키보드 단축키들을 제공한다면, iOS, iPadOS, tvOS는 그것들을 key 커멘드로서 사용 가능하다.

 

 

 

You can use SwiftUI, working together with WidgetKit, to add widgets to your app. Widgets provide quick access to relevant content from your app. Define a structure that conforms to the Widget protocol, and declare a view hierarchy for the widget.

 

해석 : SwiftUI를 사용하면 WidgetKit 을 앱에 추가할 수 있다. 위젯들은 당신의 앱과 유사한 컨텐트들에 빠른 접근이 가능하도록 한다. Widget 프로토콜을 준수하는 구조체를 정의하고 위젯을 위한 뷰 계층을 선언하라.

 

 

 

Interact with other parts of the system by invoking actions. For example, you can open a URL with an OpenURLAction instance.

 

해석 : 액션들을 호출함으로서 시스템의 다른 부분들과 상호작용이 가능하다. 예를 들어, OpenURLAction 인스턴스를 가지고 URL을 열 수 있다.

 

 

 

*정리 : 전체적으로 구조를 잡는 것에 관한 이야기 같다.  (각각 정리하면 링크 연결해놓을게요 ㅎㅎ)

 

참고 : developer.apple.com/documentation/swiftui/app-structure-and-behavior