참조 사이트
어떻게 데이터를 저장할 것이며 어떤 모델 행위를 할지 정하기.
개요
구조체
와 클래스
모두 데이터를 저장하기 좋은 방법이고 비슷하지만, 조금은 다른 점이 있습니다.
4가지 옵션을 보고 어떤 것을 정할지 정하면 됩니다.
- Use structures by default.
- Use classes when you need Objective-C interoperability.
- Use classes when you need to control the identity of the data you're modeling.
- Use structures along with protocols to adopt behavior by sharing implementations.
풀어서 써보자면 다음과 같습니다.
- 일반적으로는 구조체를 쓰기