Description
Tool for generating Swift NSManagedObject subclasses for CoreData model
MotoSwift alternatives and similar libraries
Based on the "Core Data" category.
Alternatively, view MotoSwift alternatives based on common mentions on social networks and blogs.
-
CoreStore
Unleashing the real power of Core Data with the elegance and safety of Swift -
QueryKit
A simple CoreData query language for Swift and Objective-C. -
AlecrimCoreData
a simple CoreData wrapper library written in Swift. -
Graph
Graph is a semantic database that is used to create data-driven applications. -
CoreValue
Lightweight Framework for using Core Data with Value Types -
AERecord
Super awesome Swift minion for Core Data (iOS, macOS, tvOS) -
SuperRecord
A small set of utilities to make working with CoreData and Swift a bit easier. -
Skopelos
A minimalistic, thread safe, non-boilerplate and super easy to use version of Active Record on Core Data. Simply all you need for doing Core Data. Swift flavour. -
JustPersist
JustPersist is the easiest and safest way to do persistence on iOS with Core Data support out of the box. It also allows you to migrate to any other persistence framework with minimal effort. -
CloudCore
Robust CoreData-CloudKit synchronization, including offline queuing, relationships, private, shared and public databases, field-level deltas, encrypted values, maskable attributes, cacheable assets, and more. -
Cadmium
A Swift framework that wraps CoreData, hides context complexity, and helps facilitate best practices. -
CoreDataOperation
A fast, safe, flexible operation class for updating data stored in Core Data, written in Swift.
Appwrite - The open-source backend cloud platform
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of MotoSwift or a related project?
README
MotoSwift. Managed Objects to Swift.
Generates Swift NSManagedObject subclasses.
Benefits
Why is it better than Xcode generation?
- Xcode generates properties ignoring optional flag
- Allows to customize generated code with templates
- Allows to specify type for transform properties
Why is it better than Mogenerator?
- Allows to generate extensions for machine code
Additionally it allows to generate one file for whole model, e.g. you need list of entity names
Installation
Install MotoSwift by downloading MotoSwift.pkg from the latest GitHub release and running it.
From sources.
Clone or download project.
Run make install
If you need all components in one folder run make bundle
. Now you can copy whole motoswift
folder, and run motoswift/bin/motoswift
from any place
Usage
- motoswift human [OPTIONS] MODEL_PATH - generate human code for your model. Does not overwrite file, if file already exists
Options: * --template - Path to entity template. * --file-mask - The file name mask for entity file, e.g: "{{class}}.swift" * --output - The output directory
- motoswift machine [OPTIONS] MODEL_PATH - generate machine code for your model. Overwrites file every time
Options: * --template - Path to entity template. * --file-mask - The file name mask for entity file, e.g: "{{class}}+Properties.swift" * --output - The output directory
- motoswift model [OPTIONS] MODEL_PATH - generate code for your model
Options: * --output - Output file path. * --template - Path to model template.
Examples
- Xcode style
motoswift human --template ./Templates/xcode/class.stencil --output ./SampleOutput/Xcode --file-mask "{{class}}+CoreDataClass.swift" ./Tests/MotoSwiftFrameworkTests/Resources/TypesModel.xcdatamodeld
motoswift machine --template ./Templates/xcode/properties.stencil --output ./SampleOutput/Xcode --file-mask "{{class}}+CoreDataProperties.swift" ./Tests/MotoSwiftFrameworkTests/Resources/TypesModel.xcdatamodeld
- Mogenerator style
motoswift human --template ./Templates/mogenerator/human.stencil --output ./SampleOutput/Mogenerator/Human --file-mask "{{class}}.swift" ./Tests/MotoSwiftFrameworkTests/Resources/TypesModel.xcdatamodeld
SampleOutput/Mogenerator/Human
motoswift machine --template ./Templates/mogenerator/machine.stencil --output ./SampleOutput/Mogenerator/Machine --file-mask "_{{class}}.swift" ./Tests/MotoSwiftFrameworkTests/Resources/TypesModel.xcdatamodeld
SampleOutput/Mogenerator/Machine
- All entity and field names
motoswift model --template ./Templates/model.stencil --output ./SampleOutput/Model/Model.swift ./Tests/MotoSwiftFrameworkTests/Resources/TypesModel.xcdatamodeld
SampleOutput/Model/Model.swift
Tests
make test
Releasing
make .package
Additional documentation
MotoSwift uses Stencil as template language