Awesome
Model Boiler
Model Boiler is a macOS application used to quickly generate Codable conformance when you need custom mapping for one or more keys
Gif is outdated, but you get the point
๐ฆ Installation
Homebrew Cask
- Run this command in your terminal
brew cask install model-boiler
Release
- Head over to the latest release
- Download the
Model Boiler.app.zip
. - Unzip & open the executable file.
Manual
- Download or clone the repository.
- Install the dependencies by running
carthage bootstrap --platform osx
from the unzipped folder in your terminal. - Open the
Model Boiler.xcodeproj
. - Archive.
- Choose Export ("Save Built Products" option) in the Organizer window.
- Open the executable located at:
~/Desktop/Model Boiler {DATE}/Products/Applications/Model Boiler.app
๐ป Usage
Model Boiler is a menu bar application, meaning that you won't find it's icon in the Dock. If you want to access the settings, update or quit Model Boiler then look for the icon in the top menu bar on the right side.
Generating Code
- Select your model code
- Press the Model Boiler shortcut (can be customized in settings)
- Paste the generated code
- Profit!
Settings
Key case conversion is one of the features of Model Boiler, which allows you to easily convert your key names from yourProperty
to your_property
. (note: this is overriden if custom key is specified)
Custom shortcut can be configured in the settings window of Model Boiler and the default shortcut is โ + ยง
.
Note: Model Boiler currently doesn't support nested structs. You will need to generate boilerplate code for your nested structs separately.
๐ Requirements
Xcode 11.4
Swift 5.2
:octocat: Dependencies
SwiftSyntax
A tool for inspecting and rewriting Swift code
SwiftSemantics
Convenience on top of SwiftSyntax
๐ฅ Credits
Made with โค๏ธ at Nodes.
๐ License
Model Boiler is available under the MIT license. See the LICENSE file for more info.