소스 정보
- 저장소
- MikeTreml/MissionControl
- 최근 소스 활동
- 2026년 4월 29일 22:06
- 감지된 SKILL.md 언어
- 영어
- 스타
- 1
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/MikeTreml/MissionControl --skill ios-persistence-core-data-realm명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
SOC 직업 분류 기준
| name | iOS Persistence (Core Data/Realm) |
| description | Specialized skill for iOS local data persistence solutions |
| version | 1.0.0 |
| category | iOS Data Storage |
| slug | ios-persistence |
| status | active |
This skill provides specialized capabilities for iOS local data persistence solutions including Core Data and Realm. It enables designing data models, implementing migrations, configuring iCloud sync, and optimizing database performance.
bash - Execute xcodebuild and swift commandsread - Analyze Core Data models and Realm schemaswrite - Generate model classes and configurationsedit - Update existing persistence codeglob - Search for model files and configurationsgrep - Search for patterns in persistence codeModel Design
CRUD Operations
Migrations
CloudKit Integration
Performance Optimization
Schema Definition
Queries and Filtering
Migrations
Sync Configuration
This skill integrates with the following processes:
ios-core-data-implementation.js - Core Data setup and usageoffline-first-architecture.js - Offline data strategiesmobile-security-implementation.js - Secure data storage// Persistence/PersistenceController.swift
import CoreData
import CloudKit
final class PersistenceController {
static let shared = PersistenceController()
let container: NSPersistentCloudKitContainer
init(inMemory: Bool = false) {
container = NSPersistentCloudKitContainer(name: "MyApp")
if inMemory {
container.persistentStoreDescriptions.first?.url = URL(fileURLWithPath: "/dev/null")
}
// Configure CloudKit
guard let description = container.persistentStoreDescriptions.first else {
fatalError("Failed to retrieve persistent store description")
}
description.cloudKitContainerOptions = NSPersistentCloudKitContainerOptions(
containerIdentifier: "iCloud.com.example.myapp"
)
description.setOption(true as NSNumber, forKey: NSPersistentHistoryTrackingKey)
description.setOption(true as NSNumber, forKey: NSPersistentStoreRemoteChangeNotificationPostOptionKey)
container.loadPersistentStores { description, error in
error error {
()
}
}
container.viewContext.automaticallyMergesChangesFromParent
container.viewContext.mergePolicy
}
preview: {
controller (inMemory: )
controller
}()
}
// Persistence/RealmManager.swift
import RealmSwift
final class RealmManager {
static let shared = RealmManager()
private init() {
configureRealm()
}
private func configureRealm() {
let config = Realm.Configuration(
schemaVersion: 1,
migrationBlock: { migration, oldSchemaVersion in
if oldSchemaVersion < 1 {
// Migration logic
}
}
)
Realm.Configuration.defaultConfiguration = config
}
var realm: Realm {
try! Realm()
}
}
// Models/Item+CoreDataClass.swift
import Foundation
import CoreData
@objc(Item)
public class Item: NSManagedObject {
@nonobjc public class func fetchRequest() -> NSFetchRequest<Item> {
return NSFetchRequest<Item>(entityName: "Item")
}
@NSManaged public var id: UUID
@NSManaged public var title: String
@NSManaged public var createdAt: Date
@NSManaged public var isCompleted: Bool
@NSManaged public var category: Category?
}
extension Item {
static func create(
in context: NSManagedObjectContext,
title: String,
category: Category? = nil
) -> {
item (context: context)
item.id ()
item.title title
item.createdAt ()
item.isCompleted
item.category category
item
}
( : ) -> [] {
request fetchRequest()
request.sortDescriptors [(keyPath: \.createdAt, ascending: )]
( context.fetch(request)) []
}
( : ) -> [] {
request fetchRequest()
request.predicate (format: )
request.sortDescriptors [(keyPath: \.createdAt, ascending: )]
( context.fetch(request)) []
}
}
// Data/Repository/ItemRepository.swift
import Foundation
import CoreData
import Combine
protocol ItemRepositoryProtocol {
func fetchItems() -> AnyPublisher<[Item], Error>
func addItem(title: String) -> AnyPublisher<Item, Error>
func updateItem(_ item: Item) -> AnyPublisher<Void, Error>
func deleteItem(_ item: Item) -> AnyPublisher<Void, Error>
}
final class ItemRepository: ItemRepositoryProtocol {
private let container: NSPersistentContainer
private let backgroundContext: NSManagedObjectContext
init(container: NSPersistentContainer = PersistenceController.shared.container) {
self.container = container
self.backgroundContext container.newBackgroundContext()
.backgroundContext.mergePolicy
}
() -> <[], > {
{ [ ] promise
{ }
.backgroundContext.perform {
{
items .fetchAll(in: .backgroundContext)
promise(.success(items))
} {
promise(.failure(error))
}
}
}
.eraseToAnyPublisher()
}
(: ) -> <, > {
{ [ ] promise
{ }
.backgroundContext.perform {
item .create(in: .backgroundContext, title: title)
{
.backgroundContext.save()
promise(.success(item))
} {
.backgroundContext.rollback()
promise(.failure(error))
}
}
}
.eraseToAnyPublisher()
}
( : ) -> <, > {
{ [ ] promise
{ }
.backgroundContext.perform {
{
.backgroundContext.save()
promise(.success(()))
} {
.backgroundContext.rollback()
promise(.failure(error))
}
}
}
.eraseToAnyPublisher()
}
( : ) -> <, > {
{ [ ] promise
{ }
.backgroundContext.perform {
.backgroundContext.delete(item)
{
.backgroundContext.save()
promise(.success(()))
} {
.backgroundContext.rollback()
promise(.failure(error))
}
}
}
.eraseToAnyPublisher()
}
}
// Models/TaskObject.swift
import RealmSwift
class TaskObject: Object, Identifiable {
@Persisted(primaryKey: true) var id: ObjectId
@Persisted var title: String = ""
@Persisted var dueDate: Date?
@Persisted var isCompleted: Bool = false
@Persisted var priority: Int = 0
@Persisted var tags: List<TagObject>
@Persisted(originProperty: "tasks") var project: LinkingObjects<ProjectObject>
convenience init(title: String, dueDate: Date? = nil, priority: Int = 0) {
self.init()
self.title = title
self.dueDate = dueDate
.priority priority
}
}
: , {
(primaryKey: ) id:
(indexed: ) name:
color:
}
: , {
(primaryKey: ) id:
name:
tasks: <>
}
// Data/Repository/TaskRealmRepository.swift
import Foundation
import RealmSwift
import Combine
protocol TaskRepositoryProtocol {
func fetchTasks() -> AnyPublisher<[TaskObject], Error>
func addTask(_ task: TaskObject) -> AnyPublisher<Void, Error>
func updateTask(_ task: TaskObject, with updates: (TaskObject) -> Void) -> AnyPublisher<Void, Error>
func deleteTask(_ task: TaskObject) -> AnyPublisher<Void, Error>
}
final class TaskRealmRepository: TaskRepositoryProtocol {
private let realm: Realm
init(realm: Realm = RealmManager.shared.realm) {
self.realm = realm
}
() -> <[], > {
((realm.objects(.).sorted(byKeyPath: )))
.setFailureType(to: .)
.eraseToAnyPublisher()
}
( : ) -> <, > {
{ [ ] promise
{ }
{
.realm.write {
.realm.add(task)
}
promise(.success(()))
} {
promise(.failure(error))
}
}
.eraseToAnyPublisher()
}
( : , : () -> ) -> <, > {
{ [ ] promise
{ }
{
.realm.write {
updates(task)
}
promise(.success(()))
} {
promise(.failure(error))
}
}
.eraseToAnyPublisher()
}
( : ) -> <, > {
{ [ ] promise
{ }
{
.realm.write {
.realm.delete(task)
}
promise(.success(()))
} {
promise(.failure(error))
}
}
.eraseToAnyPublisher()
}
}
swift-swiftui - iOS app developmentmobile-security - Secure data storageoffline-storage - Cross-platform offline patterns