- A description of search criteria used to retrieve data from a persistent store.
- 같은 request를 여러번 호출해야 할 경우에는 xcdatamodeld 파일에서 request를 생성해서 사용할 수 있다. 단 이렇게 하면 정렬 순서를 설정할 수 없는 단점이 있다
- resultType : The result type of the fetch request.
- context(managed object) <—> coordinator(persistent store) <—-> SQLite
- The managed object context keeps track of its managed objects and all the changes you make to them
- NSPersistentContainer : A container that encapsulates the Core Data stack in your application. 스택 세팅을 위한 helper class
- A programmatic representation of the .xcdatamodeld file describing your objects.
- database schema 역할
- 이미지 같은 경우는 Binary data 타입으로 설정 가능. 이 때 allows extenrnal storage 등의 옵션 설정을 통해 메모리 이슈를 완화할 수 있다
- String, Interger, Double, Boolean, Date, Binary data 등의 타입을 저장 가능
- Transformable 타입 : custom 타입을 저장하고 싶을 때에는 먼저NSCoding 프로토콜을 준수하도록 만든 후에 Transformable 타입으로 설정해도 된다
- NSCoding : A protocol that enables an object to be encoded and decoded for archiving and distribution.
- entity를 좀 더 용이하게 다루기 위해서 하는 작업이다
- 프로세스가 발생하는 컨텍스트(쓰레드, 디스패치큐 등)
- cold observable은 구독을 해야 이벤트를 방출하는 시퀀스로서 구독하기 전에는 아무것도 생성하지 않으므로 컨텍스트가 설정되어 있지 않은 상태로서 subscribeOn 이 유효
- hot observable은 구독 전에도 이미 이벤트를 방출하고 있는 시퀀스로서 이미 컨텍스트가 있으며 RxSwift가 이를 통제할 수 없으므로 subscribeOn 이 소용없음
- Wraps the source sequence in order to run its subscription and unsubscription logic on the specified scheduler.
- 구독 이전 연산자들의 클로저가 실행되는 장소를 지정
- 원래는 자동으로 현재 스레드에서 시퀀스가 이벤트를 방출, 가공하나 이 연산자를 통해 바꿀 수 있다