Easily conversion of JSON into Codable Structs supported by Swift 4
- macOS 10.13+
- Xcode 8.3+
- Swift 4.0+
- Download JSwift's last release
- Run the app, then quit. Do not delete the App
- Go to System Preferences -> Extensions -> Xcode Source Editor and enable the JSwiftExtension extension
- Menu items should now be available from Xcode's Editor menu
Soon available in App Store 🙌
- Clone or download the repo
- Run
pod install
- Open
JSwift.xcworkspace
- Enable target signing for both the Application and the Source Code Extension using your own developer ID
- Select the application target and then Product > Archive
- Export the archive as a macOS App
- Run the app, then quit. Do not delete the App
- Go to System Preferences -> Extensions -> Xcode Source Editor and enable the JSwiftExtension
- The menu item should now be available from Xcode's Editor menu
Paste your JSON or open a JSON file:
Selecting JSON using XCode:
Using copied JSON from your Clipboard:
Once you have your codable structs created, you can easily retrieve data using:
let url = URL(string: "http://yourjsonurl.com")
let task = URLSession.shared.dataTask(with: url!) { (data, response, error) in
let response = try JSONDecoder().decode(Main.self, from: data!)
}
task.resume()
- Codable Alamofire Support
- Cocopods Library
- Swift Dictionary Mapping Support
Thanks to my friend Seb Holt for doing JSwift's logo
JSwift is released under the MIT license. See LICENSE for details.