diff --git a/JSONExport/FileRepresenter.swift b/JSONExport/FileRepresenter.swift index b26a80e..96d286f 100755 --- a/JSONExport/FileRepresenter.swift +++ b/JSONExport/FileRepresenter.swift @@ -189,7 +189,7 @@ class FileRepresenter{ fileContent += ". All rights reserved.\n" } - fileContent += "//\tModel file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport" + // fileContent += "//\tModel file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport" if let langAuthor = lang.author{ fileContent += "\n\n//\tThe \"\(lang.displayLangName!)\" support has been made available by \(langAuthor.name!)" diff --git a/JSONExport/HeaderFileRepresenter.swift b/JSONExport/HeaderFileRepresenter.swift index c819679..dde5b12 100755 --- a/JSONExport/HeaderFileRepresenter.swift +++ b/JSONExport/HeaderFileRepresenter.swift @@ -109,7 +109,7 @@ class HeaderFileRepresenter : FileRepresenter{ } fileContent += ". All rights reserved.\n//\n\n" - fileContent += "//\tModel file Generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport\n\n" + //fileContent += "//\tModel file Generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport\n\n" } } diff --git a/JSONExport/Swift-Codable-Unwrapped.json b/JSONExport/Swift-Codable-Unwrapped.json new file mode 100644 index 0000000..9b1a0a4 --- /dev/null +++ b/JSONExport/Swift-Codable-Unwrapped.json @@ -0,0 +1,105 @@ +{ + "modelStart": "{\n", + "importForEachCustomType": "", + "reservedKeywords": [ + "abstract", + "assert", + "boolean", + "break", + "byte", + "case", + "catch", + "char", + "class", + "const", + "continue", + "default", + "do", + "double", + "else", + "enum", + "extends", + "false", + "final", + "finally", + "float", + "for", + "goto", + "if", + "implements", + "import", + "instanceof", + "int", + "interface", + "long", + "native", + "new", + "null", + "package", + "private", + "protected", + "public", + "return", + "short", + "static", + "strictfp", + "super", + "switch", + "synchronized", + "this", + "throw", + "throws", + "transient", + "true", + "try", + "void", + "volatile", + "while", + "class", + "description" + ], + "booleanGetter": "", + "briefDescription": "Defines how your JSON objects can be mapped to Swift structures using the built-in NSJSONSerialization class", + "utilityMethods": [ + ], + "dataTypes": { + "stringType": "String", + "boolType": "Bool", + "floatType": "Float", + "doubleType": "Double", + "characterType": "Character", + "longType": "Double", + "intType": "Int" + }, + "wordsToRemoveToGetArrayElementsType": [ + "[", + "]" + ], + "constructors": [ + { + "fetchBasicTypeWithSpecialNeedsPropertyFromMap": "", + "bodyStart": "{\n", + "body": "", + "bodyEnd": "\t}\n", + "fetchBasicTypePropertyFromMap": "\t\tcase = \"\"\n", + "signature": "\tenum CodingKeys: String, CodingKey ", + "fetchArrayOfCustomTypePropertyFromMap": "\t\tcase = \"\"\n", + "comment": "", + "fetchCustomTypePropertyFromMap": "\t\tcase \n" + } + ], + "modelDefinition": "\nstruct : Codable ", + "genericType": "AnyObject", + "getter": "", + "setter": "", + "fileExtension": "swift", + "arrayType": "[]", + "basicTypesWithSpecialFetchingNeeds": [ + ], + "displayLangName": "Swift - Struct - Codable - Unwrapped", + "instanceVarDefinition": "\tlet : \n", + "supportsFirstLineStatement": "false", + "modelEnd": "\n}", + "staticImports": "import Foundation", + "langName": "Swift" +} diff --git a/JSONExport/ViewController.swift b/JSONExport/ViewController.swift index 6e55e7a..bd6c0ae 100755 --- a/JSONExport/ViewController.swift +++ b/JSONExport/ViewController.swift @@ -388,7 +388,7 @@ class ViewController: NSViewController, NSUserNotificationCenterDelegate, NSTabl saveButton.isEnabled = false var str = sourceText.string! - if str.characters.count == 0{ + if str.count == 0{ runOnUiThread{ //Nothing to do, just clear any generated files self.files.removeAll(keepingCapacity: false) @@ -397,7 +397,7 @@ class ViewController: NSViewController, NSUserNotificationCenterDelegate, NSTabl return; } var rootClassName = classNameField.stringValue - if rootClassName.characters.count == 0{ + if rootClassName.count == 0{ rootClassName = "RootClass" } sourceText.isEditable = false