|
| 1 | + |
| 2 | + |
1 | 3 | # SwiftyJSONAccelerator
|
2 |
| -[](https://travis-ci.org/insanoid/SwiftyJSONAccelerator) [](https://codecov.io/gh/insanoid/SwiftyJSONAccelerator) |
3 | 4 |
|
4 |
| -**(Alpha v0.0.6)** |
| 5 | +[](https://travis-ci.org/insanoid/SwiftyJSONAccelerator) [](https://codecov.io/gh/insanoid/SwiftyJSONAccelerator) |
5 | 7 |
|
6 |
| -[Download the .app (v0.0.6)](https://github.com/insanoid/SwiftyJSONAccelerator/releases/download/v0.0.6/SwiftyJSONAccelerator.zip) |
| 8 | +** Version v1.0.0 Released! ** |
7 | 9 |
|
8 |
| - |
| 10 | +- Now generates **Swift 3** and the software itself is upgraded to Swift 3. |
| 11 | +- Unit tests and complete code coverage for file generation module. |
| 12 | +- Modular code to make adding support for other JSON mapping libraries simple. |
| 13 | +- Project upgraded with SwiftLint, Travis, CocoaPods etc. |
| 14 | + |
| 15 | +[Download the .app (v1.0.0)](https://github.com/insanoid/SwiftyJSONAccelerator/releases/download/v1.0.0/SwiftyJSONAccelerator.zip) |
9 | 16 |
|
10 | 17 | A swift model generator like the Objective-C [JSONAccelerator](http://nerdery.com/json-accelerator). Formats and generates models for the given JSON and also breaks them into files making it easy to manage and share between several models.
|
11 | 18 |
|
12 | 19 | The models that are generated depend on JSON object mapping libraries, currently the model can be generated to depend on any of the below mentioned mapping libraries:
|
13 | 20 |
|
14 | 21 | - [SwiftyJSON](https://github.com/SwiftyJSON/SwiftyJSON)
|
15 |
| -- [Hearst-DD/ObjectMapper](https://github.com/Hearst-DD/ObjectMapper) (Contributed by: [brendan09](https://github.com/brendan09)) |
| 22 | +- [Hearst-DD/ObjectMapper](https://github.com/Hearst-DD/ObjectMapper) |
16 | 23 |
|
17 | 24 | Currently, the pattern is very similar to its Objective-C counterpart. It generates classes with following properties.
|
18 | 25 |
|
19 |
| -- Initalize with `JSON` (SwiftyJSON or ObjectMapper) |
20 |
| -- Initalize with `AnyObject` |
| 26 | +- Initalize with `JSON` (SwiftyJSON or ObjectMapper) or Initalize with `Any` |
21 | 27 | - Optional `NSCoding` compliance.
|
22 |
| -- Convert object to `NSDictionary` |
| 28 | +- Convert object to `Dictionary` for description printing. |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | +- Simple configurable interface for generation of file. |
| 33 | +- Each class in the JSON is generated as a file._ |
| 34 | + |
| 35 | +## Adding New Libraries |
| 36 | + |
| 37 | +-------------------------------------------------------------------------------- |
| 38 | + |
| 39 | +- Add a new type in `JSONMappingLibrary` in [Constants.swift](SwiftyJSONAccelerator/Constants.swift). |
| 40 | +- Follow the examples in [Library-Extensions](SwiftyJSONAccelerator/Library-Extensions) and create a struct implementing`ModelFile`. Follow the other extensions for SwiftyJSON and ObjectMapper, they tell you what all you can replace based on your libraries specification. |
| 41 | +- Do the necessary UI changes for the dropdown. |
| 42 | +- Add tests for your library. |
| 43 | + |
| 44 | +## Swift 2? |
| 45 | + |
| 46 | +-------------------------------------------------------------------------------- |
| 47 | + |
| 48 | +[Download (v0.0.6)](https://github.com/insanoid/SwiftyJSONAccelerator/releases/download/v0.0.6/SwiftyJSONAccelerator.zip), the older version of the project, please keep in mind it is **no longer supported**. |
| 49 | + |
| 50 | +## Todo |
| 51 | + |
| 52 | +-------------------------------------------------------------------------------- |
23 | 53 |
|
24 |
| - |
| 54 | +There is a lot more to do, follow the [issues section](https://github.com/insanoid/SwiftyJSONAccelerator/issues), I usually try to follow up or keep the list updated with any new ideas which I plan to implement. |
25 | 55 |
|
26 |
| -*Simple configurable interface for generation of file* |
| 56 | +- Build a CLI, useful in integrated with mocks and API documentations. |
| 57 | +- Creating a better UI for the application. |
| 58 | +- Adding support for better libraries mentioned [here](https://github.com/bwhiteley/JSONShootout). |
27 | 59 |
|
| 60 | +## Contributions and Requests |
28 | 61 |
|
29 |
| - |
| 62 | +-------------------------------------------------------------------------------- |
30 | 63 |
|
31 |
| -*Each class in the JSON is generated as a file.* |
| 64 | +Any suggestions regarding code quality of the app, generated code's quality, Swift related improvements and pull requests are all very welcome. Please make sure you submit the pull request to the next release branch and not the master branch. |
32 | 65 |
|
33 |
| -## TODO |
| 66 | +## License |
34 | 67 |
|
35 |
| -- Handle blank array a bit better. |
36 |
| -- Better User Interface and icon. |
37 |
| -- Generate both `struct` and `class`. |
38 |
| -- Support for further JSON object modelling libraries. |
39 |
| -- Add tests and integrate with Travis CI. |
40 |
| -- Create a Xcode plugin and a command line executor. |
| 68 | +-------------------------------------------------------------------------------- |
41 | 69 |
|
42 |
| ---- |
43 |
| -Any suggestions regarding code quality of the app, generated code's quaility, Swift related improvements and pull requests are all very welcome. |
| 70 | +[MIT License](LICENSE) / [Karthikeya Udupa](https://karthikeya.co.uk) |
0 commit comments