Data Marshaling
▶ 데이터 마샬링(정렬)
1. A view controller acts as an intermediary between the views it manages and the data of your app.
▶ 뷰 컨트롤러는 관리하는 뷰와 앱 데이터 사이의 중개자 역할을 합니다.
2. The methods and properties of the UIViewController class let you manage the visual presentation of your app.
▶ UIViewController 클래스의 메서드와 속성을 사용하면 앱의 시각적 표현을 관리할 수 있습니다.
3. When you subclass UIViewController, you add any variables you need to manage your data in your subclass.
▶ UIViewController를 하위 클래스로 만들 때, 하위 클래스에서 데이터를 관리하는 데 필요한 모든 변수를 추가합니다.
4. Adding custom variables creates a relationship like the one in Figure 1-3, where the view controller has references to your data and to the views used to present that data.
▶ 사용자 정의 변수를 추가하면, 그림 1-3과 같은 관계가 생성됩니다. 여기서 뷰 컨트롤러에는 데이터와 해당 데이터를 표시하는 데 사용되는 뷰에 대한 참조가 있습니다.
5. Moving data back and forth between the two is your responsibility.
▶ 둘 사이에서 데이터를 이동하는 것은 당신의 책임입니다.
Figure 1-3 A view controller mediates between data objects and views

6. You should always maintain a clean separation of responsibilities within your view controllers and data objects.
▶ 뷰 컨트롤러와 데이터 개체 내에서 항상 명확한 책임 분리를 유지해야 합니다.
7. Most of the logic for ensuring the integrity of your data structures belongs in the data objects themselves.
▶ 데이터 구조의 무결성을 보장하기 위한 대부분의 로직은 데이터 개체 자체에 속합니다.
8. The view controller might validate input coming from views and then package that input in the format that your data objects require, but you should minimize the view controller’s role in managing the actual data.
▶ 뷰 컨트롤러는 뷰에서 오는 입력의 유효성을 검사한 다음 해당 입력을 데이터 개체에 필요한 형식으로 패키징할 수 있지만, 실제 데이터를 관리하는 데 있어 뷰 컨트롤러의 역할을 최소화해야 합니다.
9. A UIDocument object is one way to manage your data separately from your view controllers.
▶ UIDocument 객체는 뷰 컨트롤러와 별도로 데이터를 관리하는 한 가지 방법입니다.
10. A document object is a controller object that knows how to read and write data to persistent storage.
▶ 문서 개체는 영구 저장소에 데이터를 읽고 쓰는 방법을 알고 있는 컨트롤러 개체입니다.
11. When you subclass, you add whatever logic and methods you need to extract that data and pass it to a view controller or other parts of your app.
▶ 하위 클래스를 만들 때 해당 데이터를 추출하고, 이를 뷰 컨트롤러나 앱의 다른 부분에 전달하는 데 필요한 논리와 메서드를 추가합니다.
12. The view controller might store a copy of any data it receives to make it easier to update views, but the document still owns the true data.
▶ 뷰 컨트롤러는 뷰를 쉽게 업데이트할 수 있도록 수신한 모든 데이터의 복사본을 저장할 수 있지만, 문서는 여전히 실제 데이터를 소유합니다.
출처
View Controller Programming Guide for iOS: The Role of View Controllers
View Controller Programming Guide for iOS
developer.apple.com
'iOS 문서' 카테고리의 다른 글
| [한글 번역] View Controller Programming Guide for iOS - View Management (2) (0) | 2022.06.08 |
|---|---|
| [한글 번역] View Controller Programming Guide for iOS - The Role of View Controllers (1) (0) | 2022.06.05 |
댓글