A native macOS application built with SwiftUI that lets you open, inspect, edit and save Apple Core Data models (.xcdatamodeld) outside of Xcode.
It reproduces— and in some areas extends— the familiar Xcode Data Model inspector with a clean four-panel layout:
- File Explorer – browse model packages & versions
- Entities List – quick overview of entities
- Entity Detail – attributes, relationships & fetched properties tables
- Property Inspector – contextual editor for the selected item
Multiple models can be open at once using a tabbed interface, and full read/write support means the changes you make are compatible with Xcode and your build pipeline.
- Open any
.xcdatamodeldpackage (supports versioned models) - Edit entities, attributes, relationships, fetched properties & configurations
- Add / rename / delete model versions and switch the current version
- Undo & Redo with deep model awareness
- Multi-tab workspace to work on several models simultaneously
- XML persistence via XMLCoder – output identical to Xcode
- Keyboard shortcuts for common actions (
⌘⇧Enew entity,⌘⇧Anew attribute,⌘⇧Rnew relationship,⌘⇧Vnew version) - Native macOS look & feel (dark-mode, sidebar, toolbar, menu commands)
| Minimum | |
|---|---|
| macOS | 12.0 (Monterey) |
| Xcode | 15 or later |
| Swift | 5.7 |
| Architecture | Apple Silicon & Intel (Universal) |
git clone https://github.com/your-org/CoreDataModelEditor.git
open CoreDataModelEditor/Package.swift- Select the CoreDataModelEditor scheme
- Choose My Mac as the run destination
- ⌘R to build & launch
swift run| Step | Action |
|---|---|
| 1 | File ▸ Open… or ⌘O and choose an .xcdatamodeld package |
| 2 | Use the File Explorer (far left) to pick a model version or add a new one |
| 3 | Select an entity in the Entities List to reveal its details |
| 4 | Switch between Attributes / Relationships / Fetched Properties tabs to edit tables |
| 5 | Click any row, then refine values in the Property Inspector |
| 6 | ⌘S to save – XML is written back into the package, Xcode sees the changes instantly |
Tip: right-click lists or use toolbar buttons for Add / Delete actions.
SwiftUI App ⟶ Document-based (CoreDataModelDocument)
⟶ MVVM layer (ObservableObject models)
⟶ XML Parsing / Encoding (XMLCoder)
| Layer | Responsibility |
|---|---|
| Models | Pure Swift structs/classes mirroring Core Data concepts (CDEntity, CDAttribute, …) |
| Persistence | CoreDataModelDocument converts between models and XMLModel (the on-disk schema) and handles version packages |
| Views | Modular SwiftUI views for each panel; state propagated via @ObservedObject & @StateObject |
| Commands | App / toolbar / context menus wired to document mutation helpers with Undo support |
This separation keeps UI reactive while ensuring XML files stay 100 % compatible with Xcode.
Contributions are welcome!
- Fork the repo & create a feature branch (
git checkout -b feature/your-feature) - Follow the existing SwiftLint style (run
swiftlint --fix) - Write unit tests in
CoreDataModelEditorTestsfor all new logic - Submit a pull request describing what and why
Please open an issue first if you plan a large change— we’d love to discuss design direction.
Core Data Model Editor is released under the MIT License.
See the LICENSE file for details.