[iOS] Core Data

.onNext("Volga")·2023년 1월 11일
0

iOS

목록 보기
2/7

Core Data

Persist or cache data on a single device, or sync data to multiple devices with Cloudkit.

Single 기기에서 데이터를 유지또는 캐시 하거나, CloudKit을 이용해 Multiple 기기에 데이터를 동기화 할 수 있습니다.

Overview

먼저, 공식 문서에는 다음과 같이 나와있습니다.

Use Core Data to save your application’s permanent data for offline use, to cache temporary data, and to add undo functionality to your app on a single device. To sync data across multiple devices in a single iCloud account, Core Data automatically mirrors your schema to a CloudKit container.

Through Core Data’s Data Model editor, you define your data’s types and relationships, and generate respective class definitions. Core Data can then manage object instances at runtime to provide the following features.

정리

  • 코어 데이터를 사용하면 앱에서 영구적인 데이터를 오프라인에서 사용 할 수 있습니다.
  • 코어 데이터를 사용하면 앱에서 임시 데이터들을 캐싱 할 수 있습니다.
  • Single Device에서 앱에 대해 Undo functionality(취소?) 기능을 제공합니다.
  • 코어데이터는 자동으로 스키마를 클라우드 킷 컨테이너에 미러링을 합니다.
  • 코어 데이터는 모델 편집기가 있습니다.
  • 코어데이터의 모델편집기는 Data Type 그리고 RelationShip을 정의할수 있게 합니다.
  • 코어 데이터는 RuntimeObject Instance를 관리합니다.

Core Data가 제공하는 features

Persistance

Core Data abstracts the details of mapping your objects to a store, making it easy to save data from Swift and Objective-C without administering a database directly.

대략적인 해석을 해보면 코어데이터가 객체를 저장소에 매핑하는 세부 정보를 추상화를 해서 데이터 베이스를 직접 관리 하지않고, Swift 또는 Objective-C를 사용해서 데이터를 쉽게 저장 할 수 있습니다.

Undo and Redo of Individual or Batched Changes

Core Data’s undo manager tracks changes and can roll them back individually, in groups, or all at once, making it easy to add undo and redo support to your app.

코어 데이터의 undo manager는 변경사항을 트래킹합니다.
또한, undo manager는 변경사항에 대해 individually, in groups 또는 한번에 모두 롤백이 가능합니다.
그렇기 때문에 앱에서 undo 또는 redo에 대한 support를 쉽게 추가 할 수 있습니다.

Background Data Tasks

Perform potentially UI-blocking data tasks, like parsing JSON into objects, in the background. You can then cache or store the results to reduce server roundtrips.

이 부분이 좀 애매한데 UI-blaocking data tasks라는 워딩을 사용했는데,
Main Thread를 사용하는 Data-Task를 말하는건지.. 이런 부분이 조금은 헷갈리네요
나중에 참고할 도큐먼트

View Synchronization

Core Data also helps keep your views and data synchronized by providing data sources for table and collection views.

코어 데이터가 View들에 대해 데이터 원본을 제공해서 View와 데이터를 동기화 하는데 있어서 도움을 제공 한다는 얘기입니다.

Versioning and Migration

Core Data includes mechanisms for versioning your data model and migrating user data as your app evolves.

profile
iOS 개발자 volga입니다~

0개의 댓글