Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes in Swift-Codable.json for nil/not found key-value pairs. #140

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
d6f592d
Merge pull request #88 from AlexxNica/patch-1
Ahmed-Ali Nov 15, 2017
bf8134e
Merge pull request #96 from kashifshaikh/master
Ahmed-Ali Nov 15, 2017
16893c7
Merge pull request #93 from narlei/master
Ahmed-Ali Nov 15, 2017
c5a4da4
fix a complier error in SwiftyJSON - Class
superk589 Nov 27, 2017
779a06f
Migrate to Swift 4
serhii-londar Dec 13, 2017
e40b258
Added Swift-Codable-Struct with forced unwrapped option
mumer92 Dec 26, 2017
2f8ba42
added back credit file
mumer92 Dec 26, 2017
df54d97
Change generic type from 'AnyObject' to 'String' -> Fixes #105
Feb 12, 2018
8528d6a
Java Gson for Android: Fix method name to be "optString" instead of "…
Mar 3, 2018
02a96ed
Fix: float type issue
Mar 3, 2018
4c61a93
Update to Swift 4.2
BrychanOdlum Oct 2, 2018
0a3d17f
Updating GHANGELOG.md for release 1.0.9
Ahmed-Ali Nov 24, 2018
cdd8a4f
Merge branch 'master' of git://github.com/superk589/JSONExport into s…
Ahmed-Ali Nov 24, 2018
3b306da
Merge branch 'superk589-master' into develop
Ahmed-Ali Nov 24, 2018
30d8785
Updating CHANGELOG.md
Ahmed-Ali Nov 24, 2018
8e804f6
Merge branch 'master' of git://github.com/serhii-londar/JSONExport in…
Ahmed-Ali Nov 24, 2018
8069c92
Merge branch 'serhii-londar-master'
Ahmed-Ali Nov 24, 2018
a45d1ae
Merge branch 'serhii-londar-master' into develop
Ahmed-Ali Nov 24, 2018
c20cabb
Updating CHANGELOG.md
Ahmed-Ali Nov 24, 2018
2c3864f
Merge branch 'master' of git://github.com/mumer92/JSONExport into mum…
Ahmed-Ali Nov 24, 2018
330d94b
Merge branch 'mumer92-master' into develop
Ahmed-Ali Nov 24, 2018
9ca6bdc
Updating CHANGELOG.md
Ahmed-Ali Nov 24, 2018
a9b4ca0
Merge branch 'fix_generic_type_swift_struct_codable' of git://github.…
Ahmed-Ali Nov 24, 2018
870ee94
Merge branch 'ankushkushwaha-fix_generic_type_swift_struct_codable' i…
Ahmed-Ali Nov 24, 2018
0c5bd0d
Updating CHANGELOG.md
Ahmed-Ali Nov 24, 2018
790b7fb
Merge branch 'feature/fix_java_gson_for_android' of git://github.com/…
Ahmed-Ali Nov 24, 2018
96d1f27
Merge branch 'ty0521-fss-feature/fix_java_gson_for_android' into develop
Ahmed-Ali Nov 24, 2018
1e806c9
Updating CHANGELOG.md
Ahmed-Ali Nov 24, 2018
a0a7c7e
Merge branch 'master' of git://github.com/BrychanOdlum/JSONExport int…
Ahmed-Ali Nov 24, 2018
101a4e9
Merge branch 'BrychanOdlum-master' into develop
Ahmed-Ali Nov 24, 2018
87f71cb
Updating CHANGELOG.md
Ahmed-Ali Nov 24, 2018
a507ecf
Fixing the project file
Ahmed-Ali Nov 24, 2018
db500f5
Updating CHANGELOG.md
Ahmed-Ali Nov 24, 2018
47a897e
Adding Outlaw JSON file to the project as the merge conflicts caused …
Ahmed-Ali Nov 24, 2018
a0ec494
nit: removing empty line
Ahmed-Ali Nov 24, 2018
50e3f93
Fixed an issue with trying to figure the selected language from an UI…
Ahmed-Ali Nov 24, 2018
fe313c0
fixed: update the color under Dark Mode
Sep 6, 2019
ec2051d
Merge pull request #136 from hzb/master
huabin Sep 8, 2019
1545cbe
Changed code in swift codable so that if any key value pair is not fo…
pawan-joshi Dec 24, 2019
427f41a
swift formatted
pawan-joshi Dec 24, 2019
54e9ead
Formatting changed for some swift model jsons
pawan-joshi Jul 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Formatting changed for some swift model jsons
pawan-joshi committed Jul 23, 2020
commit 54e9ead1e9708c0366c964331f51d7b270246802
Empty file modified .gitignore
100644 → 100755
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 8 additions & 2 deletions JSONExport/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -34,11 +34,17 @@ import Cocoa

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
func applicationDidFinishLaunching(_: Notification) {



func applicationDidFinishLaunching(_ aNotification: Notification) {
// Insert code here to initialize your application
}

func applicationWillTerminate(_: Notification) {
func applicationWillTerminate(_ aNotification: Notification) {
// Insert code here to tear down your application
}


}

43 changes: 26 additions & 17 deletions JSONExport/Author.swift
Original file line number Diff line number Diff line change
@@ -7,60 +7,69 @@

import Foundation

class Author: NSObject, NSCoding {
var website: String!
var email: String!
var name: String!

class Author : NSObject, NSCoding{

var website : String!
var email : String!
var name : String!


/**
* Instantiate the instance using the passed dictionary values to set the properties values
*/
init(fromDictionary dictionary: NSDictionary) {
init(fromDictionary dictionary: NSDictionary){
website = dictionary["website"] as? String
email = dictionary["email"] as? String
name = dictionary["name"] as? String
}

/**
* Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
*/
func toDictionary() -> NSDictionary {
func toDictionary() -> NSDictionary
{
let dictionary = NSMutableDictionary()
if website != nil {
if website != nil{
dictionary["website"] = website
}
if email != nil {
if email != nil{
dictionary["email"] = email
}
if name != nil {
if name != nil{
dictionary["name"] = name
}
return dictionary
}

/**
* NSCoding required initializer.
* Fills the data from the passed decoder
*/
@objc required init(coder aDecoder: NSCoder) {
@objc required init(coder aDecoder: NSCoder)
{
website = aDecoder.decodeObject(forKey: "website") as? String
email = aDecoder.decodeObject(forKey: "email") as? String
name = aDecoder.decodeObject(forKey: "name") as? String

}

/**
* NSCoding required method.
* Encodes mode properties into the decoder
*/
@objc func encode(with aCoder: NSCoder) {
if website != nil {
@objc func encode(with aCoder: NSCoder)
{
if website != nil{
aCoder.encode(website, forKey: "website")
}
if email != nil {
if email != nil{
aCoder.encode(email, forKey: "email")
}
if name != nil {
if name != nil{
aCoder.encode(name, forKey: "name")
}

}

}
Loading