├── DeserializableSwiftGenerator.app └── Contents │ ├── Frameworks │ ├── libswiftAppKit.dylib │ ├── libswiftCore.dylib │ ├── libswiftCoreData.dylib │ ├── libswiftCoreGraphics.dylib │ ├── libswiftCoreImage.dylib │ ├── libswiftDarwin.dylib │ ├── libswiftDispatch.dylib │ ├── libswiftFoundation.dylib │ └── libswiftObjectiveC.dylib │ ├── Info.plist │ ├── MacOS │ └── DeserializableSwiftGenerator │ ├── PkgInfo │ ├── Resources │ └── Base.lproj │ │ └── MainMenu.nib │ └── _CodeSignature │ └── CodeResources ├── DeserializableSwiftGenerator.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── DeserializableSwiftGenerator.xccheckout │ └── xcuserdata │ │ └── cem.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── cem.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── DeserializableSwiftGenerator.xcscheme │ └── xcschememanagement.plist ├── DeserializableSwiftGenerator ├── AppDelegate.swift ├── Base.lproj │ └── MainMenu.xib ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── JSONHelperGenerator.swift ├── ObjectMapperGenerator.swift ├── SWClass.swift ├── SWGenerator.swift ├── SWGeneratorView.swift ├── SWJsonParser.swift └── SWProperty.swift ├── DeserializableSwiftGeneratorTests ├── DeserializableSwiftGeneratorTests.swift └── Info.plist ├── LICENSE ├── README.md └── ss.png /DeserializableSwiftGenerator.app/Contents/Frameworks/libswiftAppKit.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cemolcay/DeserializableSwiftGenerator/fe877b622fb11373f862526967aca65eede4c018/DeserializableSwiftGenerator.app/Contents/Frameworks/libswiftAppKit.dylib -------------------------------------------------------------------------------- /DeserializableSwiftGenerator.app/Contents/Frameworks/libswiftCore.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cemolcay/DeserializableSwiftGenerator/fe877b622fb11373f862526967aca65eede4c018/DeserializableSwiftGenerator.app/Contents/Frameworks/libswiftCore.dylib -------------------------------------------------------------------------------- /DeserializableSwiftGenerator.app/Contents/Frameworks/libswiftCoreData.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cemolcay/DeserializableSwiftGenerator/fe877b622fb11373f862526967aca65eede4c018/DeserializableSwiftGenerator.app/Contents/Frameworks/libswiftCoreData.dylib -------------------------------------------------------------------------------- /DeserializableSwiftGenerator.app/Contents/Frameworks/libswiftCoreGraphics.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cemolcay/DeserializableSwiftGenerator/fe877b622fb11373f862526967aca65eede4c018/DeserializableSwiftGenerator.app/Contents/Frameworks/libswiftCoreGraphics.dylib -------------------------------------------------------------------------------- /DeserializableSwiftGenerator.app/Contents/Frameworks/libswiftCoreImage.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cemolcay/DeserializableSwiftGenerator/fe877b622fb11373f862526967aca65eede4c018/DeserializableSwiftGenerator.app/Contents/Frameworks/libswiftCoreImage.dylib -------------------------------------------------------------------------------- /DeserializableSwiftGenerator.app/Contents/Frameworks/libswiftDarwin.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cemolcay/DeserializableSwiftGenerator/fe877b622fb11373f862526967aca65eede4c018/DeserializableSwiftGenerator.app/Contents/Frameworks/libswiftDarwin.dylib -------------------------------------------------------------------------------- /DeserializableSwiftGenerator.app/Contents/Frameworks/libswiftDispatch.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cemolcay/DeserializableSwiftGenerator/fe877b622fb11373f862526967aca65eede4c018/DeserializableSwiftGenerator.app/Contents/Frameworks/libswiftDispatch.dylib -------------------------------------------------------------------------------- /DeserializableSwiftGenerator.app/Contents/Frameworks/libswiftFoundation.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cemolcay/DeserializableSwiftGenerator/fe877b622fb11373f862526967aca65eede4c018/DeserializableSwiftGenerator.app/Contents/Frameworks/libswiftFoundation.dylib -------------------------------------------------------------------------------- /DeserializableSwiftGenerator.app/Contents/Frameworks/libswiftObjectiveC.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cemolcay/DeserializableSwiftGenerator/fe877b622fb11373f862526967aca65eede4c018/DeserializableSwiftGenerator.app/Contents/Frameworks/libswiftObjectiveC.dylib -------------------------------------------------------------------------------- /DeserializableSwiftGenerator.app/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 15B42 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | DeserializableSwiftGenerator 11 | CFBundleIdentifier 12 | com.questa.DeserializableSwiftGenerator 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | DeserializableSwiftGenerator 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 0.0.1 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 7B91b 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 15A278 37 | DTSDKName 38 | macosx10.11 39 | DTXcode 40 | 0710 41 | DTXcodeBuild 42 | 7B91b 43 | LSMinimumSystemVersion 44 | 10.10 45 | NSHumanReadableCopyright 46 | Copyright © 2014 Cem Olcay. All rights reserved. 47 | NSMainNibFile 48 | MainMenu 49 | NSPrincipalClass 50 | NSApplication 51 | 52 | 53 | -------------------------------------------------------------------------------- /DeserializableSwiftGenerator.app/Contents/MacOS/DeserializableSwiftGenerator: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cemolcay/DeserializableSwiftGenerator/fe877b622fb11373f862526967aca65eede4c018/DeserializableSwiftGenerator.app/Contents/MacOS/DeserializableSwiftGenerator -------------------------------------------------------------------------------- /DeserializableSwiftGenerator.app/Contents/PkgInfo: -------------------------------------------------------------------------------- 1 | APPL???? -------------------------------------------------------------------------------- /DeserializableSwiftGenerator.app/Contents/Resources/Base.lproj/MainMenu.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cemolcay/DeserializableSwiftGenerator/fe877b622fb11373f862526967aca65eede4c018/DeserializableSwiftGenerator.app/Contents/Resources/Base.lproj/MainMenu.nib -------------------------------------------------------------------------------- /DeserializableSwiftGenerator.app/Contents/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/Base.lproj/MainMenu.nib 8 | 9 | hash 10 | 11 | Z82pPy4sF2m97FHzUpz5V83clk4= 12 | 13 | optional 14 | 15 | 16 | 17 | files2 18 | 19 | Frameworks/libswiftAppKit.dylib 20 | 21 | cdhash 22 | 23 | RC6D7JRGzif86+WPN4j2wkqdeZw= 24 | 25 | requirement 26 | cdhash H"442e83ec9446ce27fcebe58f3788f6c24a9d799c" 27 | 28 | Frameworks/libswiftCore.dylib 29 | 30 | cdhash 31 | 32 | sfjBZ61HzUQrUlHBQggwZ+ADHXM= 33 | 34 | requirement 35 | cdhash H"b1f8c167ad47cd442b5251c142083067e0031d73" 36 | 37 | Frameworks/libswiftCoreData.dylib 38 | 39 | cdhash 40 | 41 | Y8hvzQgylUHwIslTLXbBNaws+Hs= 42 | 43 | requirement 44 | cdhash H"63c86fcd08329541f022c9532d76c135ac2cf87b" 45 | 46 | Frameworks/libswiftCoreGraphics.dylib 47 | 48 | cdhash 49 | 50 | vQsft9ojKF19kuAlhbfyd9YZhm4= 51 | 52 | requirement 53 | cdhash H"bd0b1fb7da23285d7d92e02585b7f277d619866e" 54 | 55 | Frameworks/libswiftCoreImage.dylib 56 | 57 | cdhash 58 | 59 | zh/ilAytcA6jN6wFi0w0hFDixcs= 60 | 61 | requirement 62 | cdhash H"ce1fe2940cad700ea337ac058b4c348450e2c5cb" 63 | 64 | Frameworks/libswiftDarwin.dylib 65 | 66 | cdhash 67 | 68 | Iod4FHaG1g/YuPdjrF1YDzQ62Oo= 69 | 70 | requirement 71 | cdhash H"228778147686d60fd8b8f763ac5d580f343ad8ea" 72 | 73 | Frameworks/libswiftDispatch.dylib 74 | 75 | cdhash 76 | 77 | sO/06kcXpJYv9zJv3LJVd4f5DXU= 78 | 79 | requirement 80 | cdhash H"b0eff4ea4717a4962ff7326fdcb2557787f90d75" 81 | 82 | Frameworks/libswiftFoundation.dylib 83 | 84 | cdhash 85 | 86 | 1RVBuQcPgBmLdTnhv54cPHcTNWA= 87 | 88 | requirement 89 | cdhash H"d51541b9070f80198b7539e1bf9e1c3c77133560" 90 | 91 | Frameworks/libswiftObjectiveC.dylib 92 | 93 | cdhash 94 | 95 | 3Q0ziwS3HsJvn/uYnRal3UAX4sI= 96 | 97 | requirement 98 | cdhash H"dd0d338b04b71ec26f9ffb989d16a5dd4017e2c2" 99 | 100 | Resources/Base.lproj/MainMenu.nib 101 | 102 | hash 103 | 104 | Z82pPy4sF2m97FHzUpz5V83clk4= 105 | 106 | optional 107 | 108 | 109 | 110 | rules 111 | 112 | ^Resources/ 113 | 114 | ^Resources/.*\.lproj/ 115 | 116 | optional 117 | 118 | weight 119 | 1000 120 | 121 | ^Resources/.*\.lproj/locversion.plist$ 122 | 123 | omit 124 | 125 | weight 126 | 1100 127 | 128 | ^version.plist$ 129 | 130 | 131 | rules2 132 | 133 | .*\.dSYM($|/) 134 | 135 | weight 136 | 11 137 | 138 | ^(.*/)?\.DS_Store$ 139 | 140 | omit 141 | 142 | weight 143 | 2000 144 | 145 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ 146 | 147 | nested 148 | 149 | weight 150 | 10 151 | 152 | ^.* 153 | 154 | ^Info\.plist$ 155 | 156 | omit 157 | 158 | weight 159 | 20 160 | 161 | ^PkgInfo$ 162 | 163 | omit 164 | 165 | weight 166 | 20 167 | 168 | ^Resources/ 169 | 170 | weight 171 | 20 172 | 173 | ^Resources/.*\.lproj/ 174 | 175 | optional 176 | 177 | weight 178 | 1000 179 | 180 | ^Resources/.*\.lproj/locversion.plist$ 181 | 182 | omit 183 | 184 | weight 185 | 1100 186 | 187 | ^[^/]+$ 188 | 189 | nested 190 | 191 | weight 192 | 10 193 | 194 | ^embedded\.provisionprofile$ 195 | 196 | weight 197 | 20 198 | 199 | ^version\.plist$ 200 | 201 | weight 202 | 20 203 | 204 | 205 | 206 | 207 | -------------------------------------------------------------------------------- /DeserializableSwiftGenerator.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | B202CF8E1A15E5A30009277F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B202CF8D1A15E5A30009277F /* AppDelegate.swift */; }; 11 | B202CF901A15E5A30009277F /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B202CF8F1A15E5A30009277F /* Images.xcassets */; }; 12 | B202CF931A15E5A30009277F /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = B202CF911A15E5A30009277F /* MainMenu.xib */; }; 13 | B202CF9F1A15E5A30009277F /* DeserializableSwiftGeneratorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B202CF9E1A15E5A30009277F /* DeserializableSwiftGeneratorTests.swift */; }; 14 | B2DC56A21A4C052300603A61 /* SWClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2DC56A11A4C052300603A61 /* SWClass.swift */; }; 15 | B2DC56A41A4C053400603A61 /* SWProperty.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2DC56A31A4C053400603A61 /* SWProperty.swift */; }; 16 | B2DC56A61A4C054F00603A61 /* SWGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2DC56A51A4C054F00603A61 /* SWGenerator.swift */; }; 17 | B2DC56A81A4C056500603A61 /* JSONHelperGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2DC56A71A4C056500603A61 /* JSONHelperGenerator.swift */; }; 18 | B2DC56AA1A4C057600603A61 /* ObjectMapperGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2DC56A91A4C057600603A61 /* ObjectMapperGenerator.swift */; }; 19 | B2DC56AC1A4C0E6B00603A61 /* SWGeneratorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2DC56AB1A4C0E6B00603A61 /* SWGeneratorView.swift */; }; 20 | B2DC56D91A4C181300603A61 /* SWJsonParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2DC56D81A4C181300603A61 /* SWJsonParser.swift */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXContainerItemProxy section */ 24 | B202CF991A15E5A30009277F /* PBXContainerItemProxy */ = { 25 | isa = PBXContainerItemProxy; 26 | containerPortal = B202CF801A15E5A30009277F /* Project object */; 27 | proxyType = 1; 28 | remoteGlobalIDString = B202CF871A15E5A30009277F; 29 | remoteInfo = DeserializableSwiftGenerator; 30 | }; 31 | /* End PBXContainerItemProxy section */ 32 | 33 | /* Begin PBXFileReference section */ 34 | B202CF881A15E5A30009277F /* DeserializableSwiftGenerator.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DeserializableSwiftGenerator.app; sourceTree = BUILT_PRODUCTS_DIR; }; 35 | B202CF8C1A15E5A30009277F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 36 | B202CF8D1A15E5A30009277F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | B202CF8F1A15E5A30009277F /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 38 | B202CF921A15E5A30009277F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; 39 | B202CF981A15E5A30009277F /* DeserializableSwiftGeneratorTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DeserializableSwiftGeneratorTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | B202CF9D1A15E5A30009277F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 41 | B202CF9E1A15E5A30009277F /* DeserializableSwiftGeneratorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeserializableSwiftGeneratorTests.swift; sourceTree = ""; }; 42 | B2DC56A11A4C052300603A61 /* SWClass.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SWClass.swift; sourceTree = ""; }; 43 | B2DC56A31A4C053400603A61 /* SWProperty.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SWProperty.swift; sourceTree = ""; }; 44 | B2DC56A51A4C054F00603A61 /* SWGenerator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SWGenerator.swift; sourceTree = ""; }; 45 | B2DC56A71A4C056500603A61 /* JSONHelperGenerator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JSONHelperGenerator.swift; sourceTree = ""; }; 46 | B2DC56A91A4C057600603A61 /* ObjectMapperGenerator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ObjectMapperGenerator.swift; sourceTree = ""; }; 47 | B2DC56AB1A4C0E6B00603A61 /* SWGeneratorView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SWGeneratorView.swift; sourceTree = ""; }; 48 | B2DC56D81A4C181300603A61 /* SWJsonParser.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SWJsonParser.swift; sourceTree = ""; }; 49 | /* End PBXFileReference section */ 50 | 51 | /* Begin PBXFrameworksBuildPhase section */ 52 | B202CF851A15E5A30009277F /* Frameworks */ = { 53 | isa = PBXFrameworksBuildPhase; 54 | buildActionMask = 2147483647; 55 | files = ( 56 | ); 57 | runOnlyForDeploymentPostprocessing = 0; 58 | }; 59 | B202CF951A15E5A30009277F /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | /* End PBXFrameworksBuildPhase section */ 67 | 68 | /* Begin PBXGroup section */ 69 | B202CF7F1A15E5A30009277F = { 70 | isa = PBXGroup; 71 | children = ( 72 | B202CF8A1A15E5A30009277F /* DeserializableSwiftGenerator */, 73 | B202CF9B1A15E5A30009277F /* DeserializableSwiftGeneratorTests */, 74 | B202CF891A15E5A30009277F /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | B202CF891A15E5A30009277F /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | B202CF881A15E5A30009277F /* DeserializableSwiftGenerator.app */, 82 | B202CF981A15E5A30009277F /* DeserializableSwiftGeneratorTests.xctest */, 83 | ); 84 | name = Products; 85 | sourceTree = ""; 86 | }; 87 | B202CF8A1A15E5A30009277F /* DeserializableSwiftGenerator */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | B202CF8D1A15E5A30009277F /* AppDelegate.swift */, 91 | B256EF411A4C316A00C70B25 /* View */, 92 | B256EF421A4C317000C70B25 /* InputParser */, 93 | B256EF3F1A4C314900C70B25 /* Data */, 94 | B256EF401A4C315E00C70B25 /* Generator */, 95 | B202CF8B1A15E5A30009277F /* Supporting Files */, 96 | ); 97 | path = DeserializableSwiftGenerator; 98 | sourceTree = ""; 99 | }; 100 | B202CF8B1A15E5A30009277F /* Supporting Files */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | B202CF911A15E5A30009277F /* MainMenu.xib */, 104 | B202CF8F1A15E5A30009277F /* Images.xcassets */, 105 | B202CF8C1A15E5A30009277F /* Info.plist */, 106 | ); 107 | name = "Supporting Files"; 108 | sourceTree = ""; 109 | }; 110 | B202CF9B1A15E5A30009277F /* DeserializableSwiftGeneratorTests */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | B202CF9E1A15E5A30009277F /* DeserializableSwiftGeneratorTests.swift */, 114 | B202CF9C1A15E5A30009277F /* Supporting Files */, 115 | ); 116 | path = DeserializableSwiftGeneratorTests; 117 | sourceTree = ""; 118 | }; 119 | B202CF9C1A15E5A30009277F /* Supporting Files */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | B202CF9D1A15E5A30009277F /* Info.plist */, 123 | ); 124 | name = "Supporting Files"; 125 | sourceTree = ""; 126 | }; 127 | B256EF3F1A4C314900C70B25 /* Data */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | B2DC56A11A4C052300603A61 /* SWClass.swift */, 131 | B2DC56A31A4C053400603A61 /* SWProperty.swift */, 132 | ); 133 | name = Data; 134 | sourceTree = ""; 135 | }; 136 | B256EF401A4C315E00C70B25 /* Generator */ = { 137 | isa = PBXGroup; 138 | children = ( 139 | B2DC56A51A4C054F00603A61 /* SWGenerator.swift */, 140 | B2DC56A71A4C056500603A61 /* JSONHelperGenerator.swift */, 141 | B2DC56A91A4C057600603A61 /* ObjectMapperGenerator.swift */, 142 | ); 143 | name = Generator; 144 | sourceTree = ""; 145 | }; 146 | B256EF411A4C316A00C70B25 /* View */ = { 147 | isa = PBXGroup; 148 | children = ( 149 | B2DC56AB1A4C0E6B00603A61 /* SWGeneratorView.swift */, 150 | ); 151 | name = View; 152 | sourceTree = ""; 153 | }; 154 | B256EF421A4C317000C70B25 /* InputParser */ = { 155 | isa = PBXGroup; 156 | children = ( 157 | B2DC56D81A4C181300603A61 /* SWJsonParser.swift */, 158 | ); 159 | name = InputParser; 160 | sourceTree = ""; 161 | }; 162 | /* End PBXGroup section */ 163 | 164 | /* Begin PBXNativeTarget section */ 165 | B202CF871A15E5A30009277F /* DeserializableSwiftGenerator */ = { 166 | isa = PBXNativeTarget; 167 | buildConfigurationList = B202CFA21A15E5A30009277F /* Build configuration list for PBXNativeTarget "DeserializableSwiftGenerator" */; 168 | buildPhases = ( 169 | B202CF841A15E5A30009277F /* Sources */, 170 | B202CF851A15E5A30009277F /* Frameworks */, 171 | B202CF861A15E5A30009277F /* Resources */, 172 | ); 173 | buildRules = ( 174 | ); 175 | dependencies = ( 176 | ); 177 | name = DeserializableSwiftGenerator; 178 | productName = DeserializableSwiftGenerator; 179 | productReference = B202CF881A15E5A30009277F /* DeserializableSwiftGenerator.app */; 180 | productType = "com.apple.product-type.application"; 181 | }; 182 | B202CF971A15E5A30009277F /* DeserializableSwiftGeneratorTests */ = { 183 | isa = PBXNativeTarget; 184 | buildConfigurationList = B202CFA51A15E5A30009277F /* Build configuration list for PBXNativeTarget "DeserializableSwiftGeneratorTests" */; 185 | buildPhases = ( 186 | B202CF941A15E5A30009277F /* Sources */, 187 | B202CF951A15E5A30009277F /* Frameworks */, 188 | B202CF961A15E5A30009277F /* Resources */, 189 | ); 190 | buildRules = ( 191 | ); 192 | dependencies = ( 193 | B202CF9A1A15E5A30009277F /* PBXTargetDependency */, 194 | ); 195 | name = DeserializableSwiftGeneratorTests; 196 | productName = DeserializableSwiftGeneratorTests; 197 | productReference = B202CF981A15E5A30009277F /* DeserializableSwiftGeneratorTests.xctest */; 198 | productType = "com.apple.product-type.bundle.unit-test"; 199 | }; 200 | /* End PBXNativeTarget section */ 201 | 202 | /* Begin PBXProject section */ 203 | B202CF801A15E5A30009277F /* Project object */ = { 204 | isa = PBXProject; 205 | attributes = { 206 | LastSwiftMigration = 0710; 207 | LastSwiftUpdateCheck = 0710; 208 | LastUpgradeCheck = 0610; 209 | ORGANIZATIONNAME = "Cem Olcay"; 210 | TargetAttributes = { 211 | B202CF871A15E5A30009277F = { 212 | CreatedOnToolsVersion = 6.1; 213 | }; 214 | B202CF971A15E5A30009277F = { 215 | CreatedOnToolsVersion = 6.1; 216 | TestTargetID = B202CF871A15E5A30009277F; 217 | }; 218 | }; 219 | }; 220 | buildConfigurationList = B202CF831A15E5A30009277F /* Build configuration list for PBXProject "DeserializableSwiftGenerator" */; 221 | compatibilityVersion = "Xcode 3.2"; 222 | developmentRegion = English; 223 | hasScannedForEncodings = 0; 224 | knownRegions = ( 225 | en, 226 | Base, 227 | ); 228 | mainGroup = B202CF7F1A15E5A30009277F; 229 | productRefGroup = B202CF891A15E5A30009277F /* Products */; 230 | projectDirPath = ""; 231 | projectRoot = ""; 232 | targets = ( 233 | B202CF871A15E5A30009277F /* DeserializableSwiftGenerator */, 234 | B202CF971A15E5A30009277F /* DeserializableSwiftGeneratorTests */, 235 | ); 236 | }; 237 | /* End PBXProject section */ 238 | 239 | /* Begin PBXResourcesBuildPhase section */ 240 | B202CF861A15E5A30009277F /* Resources */ = { 241 | isa = PBXResourcesBuildPhase; 242 | buildActionMask = 2147483647; 243 | files = ( 244 | B202CF901A15E5A30009277F /* Images.xcassets in Resources */, 245 | B202CF931A15E5A30009277F /* MainMenu.xib in Resources */, 246 | ); 247 | runOnlyForDeploymentPostprocessing = 0; 248 | }; 249 | B202CF961A15E5A30009277F /* Resources */ = { 250 | isa = PBXResourcesBuildPhase; 251 | buildActionMask = 2147483647; 252 | files = ( 253 | ); 254 | runOnlyForDeploymentPostprocessing = 0; 255 | }; 256 | /* End PBXResourcesBuildPhase section */ 257 | 258 | /* Begin PBXSourcesBuildPhase section */ 259 | B202CF841A15E5A30009277F /* Sources */ = { 260 | isa = PBXSourcesBuildPhase; 261 | buildActionMask = 2147483647; 262 | files = ( 263 | B2DC56D91A4C181300603A61 /* SWJsonParser.swift in Sources */, 264 | B2DC56A21A4C052300603A61 /* SWClass.swift in Sources */, 265 | B2DC56A41A4C053400603A61 /* SWProperty.swift in Sources */, 266 | B2DC56AA1A4C057600603A61 /* ObjectMapperGenerator.swift in Sources */, 267 | B2DC56AC1A4C0E6B00603A61 /* SWGeneratorView.swift in Sources */, 268 | B2DC56A81A4C056500603A61 /* JSONHelperGenerator.swift in Sources */, 269 | B202CF8E1A15E5A30009277F /* AppDelegate.swift in Sources */, 270 | B2DC56A61A4C054F00603A61 /* SWGenerator.swift in Sources */, 271 | ); 272 | runOnlyForDeploymentPostprocessing = 0; 273 | }; 274 | B202CF941A15E5A30009277F /* Sources */ = { 275 | isa = PBXSourcesBuildPhase; 276 | buildActionMask = 2147483647; 277 | files = ( 278 | B202CF9F1A15E5A30009277F /* DeserializableSwiftGeneratorTests.swift in Sources */, 279 | ); 280 | runOnlyForDeploymentPostprocessing = 0; 281 | }; 282 | /* End PBXSourcesBuildPhase section */ 283 | 284 | /* Begin PBXTargetDependency section */ 285 | B202CF9A1A15E5A30009277F /* PBXTargetDependency */ = { 286 | isa = PBXTargetDependency; 287 | target = B202CF871A15E5A30009277F /* DeserializableSwiftGenerator */; 288 | targetProxy = B202CF991A15E5A30009277F /* PBXContainerItemProxy */; 289 | }; 290 | /* End PBXTargetDependency section */ 291 | 292 | /* Begin PBXVariantGroup section */ 293 | B202CF911A15E5A30009277F /* MainMenu.xib */ = { 294 | isa = PBXVariantGroup; 295 | children = ( 296 | B202CF921A15E5A30009277F /* Base */, 297 | ); 298 | name = MainMenu.xib; 299 | sourceTree = ""; 300 | }; 301 | /* End PBXVariantGroup section */ 302 | 303 | /* Begin XCBuildConfiguration section */ 304 | B202CFA01A15E5A30009277F /* Debug */ = { 305 | isa = XCBuildConfiguration; 306 | buildSettings = { 307 | ALWAYS_SEARCH_USER_PATHS = NO; 308 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 309 | CLANG_CXX_LIBRARY = "libc++"; 310 | CLANG_ENABLE_MODULES = YES; 311 | CLANG_ENABLE_OBJC_ARC = YES; 312 | CLANG_WARN_BOOL_CONVERSION = YES; 313 | CLANG_WARN_CONSTANT_CONVERSION = YES; 314 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 315 | CLANG_WARN_EMPTY_BODY = YES; 316 | CLANG_WARN_ENUM_CONVERSION = YES; 317 | CLANG_WARN_INT_CONVERSION = YES; 318 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 319 | CLANG_WARN_UNREACHABLE_CODE = YES; 320 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 321 | CODE_SIGN_IDENTITY = "-"; 322 | COPY_PHASE_STRIP = NO; 323 | ENABLE_STRICT_OBJC_MSGSEND = YES; 324 | GCC_C_LANGUAGE_STANDARD = gnu99; 325 | GCC_DYNAMIC_NO_PIC = NO; 326 | GCC_OPTIMIZATION_LEVEL = 0; 327 | GCC_PREPROCESSOR_DEFINITIONS = ( 328 | "DEBUG=1", 329 | "$(inherited)", 330 | ); 331 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 332 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 333 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 334 | GCC_WARN_UNDECLARED_SELECTOR = YES; 335 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 336 | GCC_WARN_UNUSED_FUNCTION = YES; 337 | GCC_WARN_UNUSED_VARIABLE = YES; 338 | MACOSX_DEPLOYMENT_TARGET = 10.10; 339 | MTL_ENABLE_DEBUG_INFO = YES; 340 | ONLY_ACTIVE_ARCH = YES; 341 | SDKROOT = macosx; 342 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 343 | }; 344 | name = Debug; 345 | }; 346 | B202CFA11A15E5A30009277F /* Release */ = { 347 | isa = XCBuildConfiguration; 348 | buildSettings = { 349 | ALWAYS_SEARCH_USER_PATHS = NO; 350 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 351 | CLANG_CXX_LIBRARY = "libc++"; 352 | CLANG_ENABLE_MODULES = YES; 353 | CLANG_ENABLE_OBJC_ARC = YES; 354 | CLANG_WARN_BOOL_CONVERSION = YES; 355 | CLANG_WARN_CONSTANT_CONVERSION = YES; 356 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 357 | CLANG_WARN_EMPTY_BODY = YES; 358 | CLANG_WARN_ENUM_CONVERSION = YES; 359 | CLANG_WARN_INT_CONVERSION = YES; 360 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 361 | CLANG_WARN_UNREACHABLE_CODE = YES; 362 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 363 | CODE_SIGN_IDENTITY = "-"; 364 | COPY_PHASE_STRIP = YES; 365 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 366 | ENABLE_NS_ASSERTIONS = NO; 367 | ENABLE_STRICT_OBJC_MSGSEND = YES; 368 | GCC_C_LANGUAGE_STANDARD = gnu99; 369 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 370 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 371 | GCC_WARN_UNDECLARED_SELECTOR = YES; 372 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 373 | GCC_WARN_UNUSED_FUNCTION = YES; 374 | GCC_WARN_UNUSED_VARIABLE = YES; 375 | MACOSX_DEPLOYMENT_TARGET = 10.10; 376 | MTL_ENABLE_DEBUG_INFO = NO; 377 | SDKROOT = macosx; 378 | }; 379 | name = Release; 380 | }; 381 | B202CFA31A15E5A30009277F /* Debug */ = { 382 | isa = XCBuildConfiguration; 383 | buildSettings = { 384 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 385 | COMBINE_HIDPI_IMAGES = YES; 386 | INFOPLIST_FILE = DeserializableSwiftGenerator/Info.plist; 387 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 388 | PRODUCT_NAME = "$(TARGET_NAME)"; 389 | }; 390 | name = Debug; 391 | }; 392 | B202CFA41A15E5A30009277F /* Release */ = { 393 | isa = XCBuildConfiguration; 394 | buildSettings = { 395 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 396 | COMBINE_HIDPI_IMAGES = YES; 397 | INFOPLIST_FILE = DeserializableSwiftGenerator/Info.plist; 398 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 399 | PRODUCT_NAME = "$(TARGET_NAME)"; 400 | }; 401 | name = Release; 402 | }; 403 | B202CFA61A15E5A30009277F /* Debug */ = { 404 | isa = XCBuildConfiguration; 405 | buildSettings = { 406 | BUNDLE_LOADER = "$(TEST_HOST)"; 407 | COMBINE_HIDPI_IMAGES = YES; 408 | FRAMEWORK_SEARCH_PATHS = ( 409 | "$(DEVELOPER_FRAMEWORKS_DIR)", 410 | "$(inherited)", 411 | ); 412 | GCC_PREPROCESSOR_DEFINITIONS = ( 413 | "DEBUG=1", 414 | "$(inherited)", 415 | ); 416 | INFOPLIST_FILE = DeserializableSwiftGeneratorTests/Info.plist; 417 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 418 | PRODUCT_NAME = "$(TARGET_NAME)"; 419 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DeserializableSwiftGenerator.app/Contents/MacOS/DeserializableSwiftGenerator"; 420 | }; 421 | name = Debug; 422 | }; 423 | B202CFA71A15E5A30009277F /* Release */ = { 424 | isa = XCBuildConfiguration; 425 | buildSettings = { 426 | BUNDLE_LOADER = "$(TEST_HOST)"; 427 | COMBINE_HIDPI_IMAGES = YES; 428 | FRAMEWORK_SEARCH_PATHS = ( 429 | "$(DEVELOPER_FRAMEWORKS_DIR)", 430 | "$(inherited)", 431 | ); 432 | INFOPLIST_FILE = DeserializableSwiftGeneratorTests/Info.plist; 433 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 434 | PRODUCT_NAME = "$(TARGET_NAME)"; 435 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DeserializableSwiftGenerator.app/Contents/MacOS/DeserializableSwiftGenerator"; 436 | }; 437 | name = Release; 438 | }; 439 | /* End XCBuildConfiguration section */ 440 | 441 | /* Begin XCConfigurationList section */ 442 | B202CF831A15E5A30009277F /* Build configuration list for PBXProject "DeserializableSwiftGenerator" */ = { 443 | isa = XCConfigurationList; 444 | buildConfigurations = ( 445 | B202CFA01A15E5A30009277F /* Debug */, 446 | B202CFA11A15E5A30009277F /* Release */, 447 | ); 448 | defaultConfigurationIsVisible = 0; 449 | defaultConfigurationName = Release; 450 | }; 451 | B202CFA21A15E5A30009277F /* Build configuration list for PBXNativeTarget "DeserializableSwiftGenerator" */ = { 452 | isa = XCConfigurationList; 453 | buildConfigurations = ( 454 | B202CFA31A15E5A30009277F /* Debug */, 455 | B202CFA41A15E5A30009277F /* Release */, 456 | ); 457 | defaultConfigurationIsVisible = 0; 458 | defaultConfigurationName = Release; 459 | }; 460 | B202CFA51A15E5A30009277F /* Build configuration list for PBXNativeTarget "DeserializableSwiftGeneratorTests" */ = { 461 | isa = XCConfigurationList; 462 | buildConfigurations = ( 463 | B202CFA61A15E5A30009277F /* Debug */, 464 | B202CFA71A15E5A30009277F /* Release */, 465 | ); 466 | defaultConfigurationIsVisible = 0; 467 | defaultConfigurationName = Release; 468 | }; 469 | /* End XCConfigurationList section */ 470 | }; 471 | rootObject = B202CF801A15E5A30009277F /* Project object */; 472 | } 473 | -------------------------------------------------------------------------------- /DeserializableSwiftGenerator.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DeserializableSwiftGenerator.xcodeproj/project.xcworkspace/xcshareddata/DeserializableSwiftGenerator.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 36746D40-0CF7-4EC9-B760-0769B6277782 9 | IDESourceControlProjectName 10 | DeserializableSwiftGenerator 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 728D82801C5399F006D293EA005B5D59CDBF475B 14 | https://github.com/cemolcay/DeserializableSwiftGenerator.git 15 | 16 | IDESourceControlProjectPath 17 | DeserializableSwiftGenerator.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 728D82801C5399F006D293EA005B5D59CDBF475B 21 | ../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/cemolcay/DeserializableSwiftGenerator.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 728D82801C5399F006D293EA005B5D59CDBF475B 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 728D82801C5399F006D293EA005B5D59CDBF475B 36 | IDESourceControlWCCName 37 | DeserializableSwiftGenerator 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /DeserializableSwiftGenerator.xcodeproj/project.xcworkspace/xcuserdata/cem.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cemolcay/DeserializableSwiftGenerator/fe877b622fb11373f862526967aca65eede4c018/DeserializableSwiftGenerator.xcodeproj/project.xcworkspace/xcuserdata/cem.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /DeserializableSwiftGenerator.xcodeproj/xcuserdata/cem.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /DeserializableSwiftGenerator.xcodeproj/xcuserdata/cem.xcuserdatad/xcschemes/DeserializableSwiftGenerator.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 94 | 100 | 101 | 102 | 103 | 105 | 106 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /DeserializableSwiftGenerator.xcodeproj/xcuserdata/cem.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DeserializableSwiftGenerator.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | B202CF871A15E5A30009277F 16 | 17 | primary 18 | 19 | 20 | B202CF971A15E5A30009277F 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /DeserializableSwiftGenerator/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // DeserializableSwiftGenerator 4 | // 5 | // Created by Cem Olcay on 14/11/14. 6 | // Copyright (c) 2014 Cem Olcay. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import Foundation 11 | import AppKit 12 | 13 | 14 | @NSApplicationMain 15 | class AppDelegate: NSObject, NSApplicationDelegate { 16 | 17 | @IBOutlet weak var window: NSWindow! 18 | 19 | func applicationDidFinishLaunching(aNotification: NSNotification) { 20 | let testCamel = "hello_world" 21 | Swift.print(testCamel.camelCasedString) 22 | } 23 | 24 | func applicationWillTerminate(aNotification: NSNotification) { 25 | 26 | } 27 | 28 | func testGenerator () { 29 | print("test starting") 30 | 31 | let p1 = SWProperty (name: "name", type: "String") 32 | let p2 = SWProperty (name: "surname", type: "String") 33 | let p3 = SWProperty (name: "age", type: "Int") 34 | 35 | let c = SWClass (name: "Person", superName: "TestSuper", properties: [p1, p2, p3]) 36 | 37 | let gen = ObjectMapperGenerator () 38 | let save = gen.saveToDesktop(c) 39 | print("did save \(save)") 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /DeserializableSwiftGenerator/Base.lproj/MainMenu.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | Default 545 | 546 | 547 | 548 | 549 | 550 | 551 | Left to Right 552 | 553 | 554 | 555 | 556 | 557 | 558 | Right to Left 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | Default 570 | 571 | 572 | 573 | 574 | 575 | 576 | Left to Right 577 | 578 | 579 | 580 | 581 | 582 | 583 | Right to Left 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 720 | 721 | 722 | 723 | 724 | 725 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | -------------------------------------------------------------------------------- /DeserializableSwiftGenerator/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /DeserializableSwiftGenerator/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.questa.$(PRODUCT_NAME:rfc1034identifier) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 0.0.1 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | Copyright © 2014 Cem Olcay. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /DeserializableSwiftGenerator/JSONHelperGenerator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JSONHelperGenerator.swift 3 | // DeserializableSwiftGenerator 4 | // 5 | // Created by Cem Olcay on 25/12/14. 6 | // Copyright (c) 2014 Cem Olcay. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | extension String { 12 | subscript (i: Int) -> String { 13 | return String(Array(self.characters)[i]) 14 | } 15 | } 16 | 17 | final class JSONHelperGenerator: SWGenerator { 18 | 19 | // MARK: SWGeneratorProtocol 20 | 21 | override var deserialzeProtocolName: String? { 22 | return "Deserializable" 23 | } 24 | 25 | override func generateClassBody(sw: SWClass) -> String { 26 | var body = "\trequired init(data: [String : AnyObject]) {\n" 27 | if sw.superName != nil { 28 | body += "\t\tsuper.init(data: data)\n" 29 | } else { 30 | body += "\n" 31 | } 32 | if let p = sw.properties { 33 | for prop in p { 34 | body += "\t\t" + 35 | fixName(prop.name) + 36 | " <-- " + 37 | " data[\"" + 38 | prop.name + 39 | "\"]\n" 40 | } 41 | } 42 | body += "\t}\n" 43 | return body 44 | } 45 | 46 | func fixName (name: String) -> String { 47 | if name == "data" { 48 | return "self.data" 49 | } 50 | return name 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /DeserializableSwiftGenerator/ObjectMapperGenerator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ObjectMapperGenerator.swift 3 | // DeserializableSwiftGenerator 4 | // 5 | // Created by Cem Olcay on 25/12/14. 6 | // Copyright (c) 2014 Cem Olcay. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | final class ObjectMapperGenerator: SWGenerator { 12 | 13 | // MARK: SWGeneratorProtocol 14 | 15 | override var deserialzeProtocolName: String? { 16 | return "MapperProtocol" 17 | } 18 | 19 | override func generateClassBody(sw: SWClass) -> String { 20 | var body = generateInit(sw) 21 | body += "\n" 22 | body += generateMap(sw) 23 | return body 24 | } 25 | 26 | // MARK: ObjectMapper Generator 27 | 28 | func generateInit(sw: SWClass) -> String { 29 | var initMethod = "\n\t// MARK: Mappable\n\n\t" 30 | initMethod += sw.superName == nil ? "" : "override " 31 | initMethod += "class func newInstance(map: Map) -> Mappable? {\n" 32 | initMethod += "\t\treturn " + sw.name + "()\n" 33 | initMethod += "\t}\n" 34 | return initMethod 35 | } 36 | 37 | func generateMap (sw: SWClass) -> String { 38 | var map = "" 39 | if sw.superName != nil { 40 | map = "\toverride func mapping(map: Map) {\n" 41 | map += "\t\tsuper.mapping(map)\n" 42 | } else { 43 | map = "\tfunc mapping(map: Map) {\n" 44 | } 45 | if let p = sw.properties { 46 | for prop in p { 47 | map += "\t\t" + 48 | prop.name + 49 | " <- " + 50 | "map[\"" + 51 | prop.name + 52 | "\"]\n" 53 | } 54 | } 55 | map += "\t}\n" 56 | return map 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /DeserializableSwiftGenerator/SWClass.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SWClass.swift 3 | // DeserializableSwiftGenerator 4 | // 5 | // Created by Cem Olcay on 25/12/14. 6 | // Copyright (c) 2014 Cem Olcay. All rights reserved. 7 | // 8 | 9 | 10 | final class SWClass { 11 | var name: String 12 | var superName: String? 13 | var properties: [SWProperty]? 14 | 15 | init (name: String, superName: String?, properties: [SWProperty]?) { 16 | self.name = name 17 | self.superName = superName 18 | self.properties = properties 19 | } 20 | 21 | func getHeader (protocolName: String?) -> String { 22 | var header = "class " + name 23 | if let s = superName { 24 | header += ": " + s 25 | if let p = protocolName { 26 | header += ", " + p 27 | } 28 | } else { 29 | if let p = protocolName { 30 | header += ": " + p 31 | } 32 | } 33 | return header + " {\n" 34 | } 35 | 36 | func getFields () -> String { 37 | var fields = "" 38 | if let p = properties { 39 | for prop in p { 40 | fields += "\t" + prop.getVariableLine() + "\n" 41 | } 42 | } 43 | return fields 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /DeserializableSwiftGenerator/SWGenerator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SWGenerator.swift 3 | // DeserializableSwiftGenerator 4 | // 5 | // Created by Cem Olcay on 25/12/14. 6 | // Copyright (c) 2014 Cem Olcay. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | protocol SWGeneratorProtocol { 12 | var deserialzeProtocolName: String? { get } 13 | func generateClassBody (sw: SWClass) -> String 14 | } 15 | 16 | class SWGenerator: SWGeneratorProtocol { 17 | var deserialzeProtocolName: String? { 18 | return nil 19 | } 20 | 21 | func generateClassBody(sw: SWClass) -> String { 22 | return "" 23 | } 24 | 25 | func generateSwiftFile (sw: SWClass) -> String { 26 | var gen = sw.getHeader(deserialzeProtocolName) 27 | gen += sw.getFields() + "\n" 28 | gen += generateClassBody(sw) 29 | gen += "}" 30 | return gen 31 | } 32 | 33 | func saveToDesktop (sw: SWClass) -> Bool { 34 | let paths = NSSearchPathForDirectoriesInDomains(.DesktopDirectory, .AllDomainsMask, true) 35 | let desktop = paths[0] 36 | let path = desktop + "/" + sw.name + ".swift" 37 | let file = generateSwiftFile(sw) 38 | do { 39 | try file.writeToFile(path, 40 | atomically: false, 41 | encoding: NSUTF8StringEncoding) 42 | return true 43 | } catch _ { 44 | return false 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /DeserializableSwiftGenerator/SWGeneratorView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SWGeneratorView.swift 3 | // DeserializableSwiftGenerator 4 | // 5 | // Created by Cem Olcay on 25/12/14. 6 | // Copyright (c) 2014 Cem Olcay. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | enum GenerateMethod: Int { 12 | case JSONHelper = 0 13 | case ObjectMapper = 1 14 | } 15 | 16 | class SWGeneratorView: NSView { 17 | @IBOutlet var nameTextField: NSTextField! 18 | @IBOutlet var superTextField: NSTextField! 19 | @IBOutlet var jsonTextView: NSTextView! 20 | @IBOutlet var generateMethodComboBox: NSPopUpButton! 21 | 22 | @IBAction func generatePressed(sender: AnyObject) { 23 | if isValid() { 24 | let button = sender as! NSButton 25 | button.enabled = false 26 | generate() 27 | button.enabled = true 28 | } 29 | } 30 | 31 | override func awakeFromNib() { 32 | jsonTextView.font = NSFontManager.sharedFontManager() 33 | .fontWithFamily("Menlo", 34 | traits: NSFontTraitMask.BoldFontMask, 35 | weight: 1, 36 | size: 11) 37 | } 38 | 39 | func isValid () -> Bool { 40 | if nameTextField.stringValue.isEmpty { 41 | Swift.print("not valid, name empty") 42 | return false 43 | } 44 | if (jsonTextView.string!).characters.count > 0 { 45 | Swift.print("valid") 46 | return true 47 | } else { 48 | Swift.print("not valid json empty") 49 | return false 50 | } 51 | } 52 | 53 | func generate () { 54 | let name: String = nameTextField.stringValue 55 | var superName: String? = superTextField.stringValue 56 | if superTextField.stringValue.isEmpty { 57 | superName = nil 58 | } 59 | let json = jsonTextView.string! 60 | let parser = SWJsonParser() 61 | let classes = parser.parseJsonToSWClass(name, superName: superName, jsonString: json) 62 | var gen: SWGenerator! 63 | let method = GenerateMethod (rawValue: generateMethodComboBox.indexOfSelectedItem)! 64 | switch method { 65 | case .JSONHelper: 66 | gen = JSONHelperGenerator() 67 | 68 | case .ObjectMapper: 69 | gen = ObjectMapperGenerator() 70 | } 71 | for sw in classes { 72 | gen.saveToDesktop(sw) 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /DeserializableSwiftGenerator/SWJsonParser.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SWJsonParser.swift 3 | // DeserializableSwiftGenerator 4 | // 5 | // Created by Cem Olcay on 25/12/14. 6 | // Copyright (c) 2014 Cem Olcay. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | extension String { 12 | var camelCasedString: String { 13 | let source = self 14 | if source.characters.contains(" ") { 15 | let first = source.substringToIndex(source.startIndex.advancedBy(1)) 16 | let cammel = NSString(format: "%@", (source as NSString).capitalizedString.stringByReplacingOccurrencesOfString(" ", withString: "", options: [], range: nil)) as String 17 | let rest = String(cammel.characters.dropFirst()) 18 | return "\(first)\(rest)" 19 | } else { 20 | let first = (source as NSString).lowercaseString.substringToIndex(source.startIndex.advancedBy(1)) 21 | let rest = String(source.characters.dropFirst()) 22 | return "\(first)\(rest)" 23 | } 24 | } 25 | } 26 | 27 | final class SWJsonParser { 28 | private var generatedSWClasses: [SWClass] = [] 29 | private var generatedSWClassPrefix: String? 30 | private var generatedSWClassName: String = "" 31 | private var generatedSWClassSuperName: String? = nil 32 | 33 | // MARK: Parser 34 | 35 | func parseJsonToSWClass(name: String, superName: String?, jsonString: String) -> [SWClass] { 36 | self.generatedSWClasses = [] 37 | self.generatedSWClassName = name 38 | self.generatedSWClassSuperName = superName 39 | // detect class prefix between paranthesis 40 | let start = name.rangeOfString("(") 41 | let end = name.rangeOfString(")") 42 | if (end?.startIndex > start?.startIndex) { 43 | generatedSWClassPrefix = name.substringWithRange(start!.endIndex...end!.startIndex.predecessor()) 44 | generatedSWClassName = generatedSWClassPrefix ?? "" + name.substringFromIndex(end!.endIndex) 45 | } 46 | // genereate swift class form json dictionary 47 | if let dict = jsonStringToDict(jsonString) { 48 | let sw = generateSWClass(generatedSWClassName, superName: superName, dict: dict) 49 | generatedSWClasses.append(sw) 50 | } 51 | return generatedSWClasses 52 | } 53 | 54 | // MARK: Helpers 55 | 56 | private func jsonStringToDict (jsonString: String) -> [String: AnyObject]? { 57 | let data = jsonString.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false) 58 | if let d = data { 59 | return jsonDataToDict(d) 60 | } else { 61 | return nil 62 | } 63 | } 64 | 65 | private func jsonDataToDict (data: NSData) -> [String: AnyObject]? { 66 | var jsonError: NSError? = nil 67 | let dict: AnyObject? 68 | do { 69 | dict = try NSJSONSerialization.JSONObjectWithData(data, options: []) 70 | } catch let error as NSError { 71 | jsonError = error 72 | dict = nil 73 | } 74 | if let e = jsonError { 75 | print("json error " + e.description) 76 | return nil 77 | } else { 78 | if let d = dict as? [String: AnyObject] { 79 | return d 80 | } else if let d = dict as? [AnyObject] { 81 | if let d0 = d[0] as? [String: AnyObject] { 82 | return d0 83 | } else { 84 | print("json nil") 85 | return nil 86 | } 87 | } else { 88 | print("json nil") 89 | return nil 90 | } 91 | } 92 | } 93 | 94 | // MARK: Generators 95 | 96 | private func generateSWClass(name: String, superName: String?, dict: [String: AnyObject]) -> SWClass { 97 | let props = generateProperties(dict) 98 | let sw = SWClass (name: name, superName: superName, properties: props) 99 | return sw 100 | } 101 | 102 | private func generateProperties(dict: [String: AnyObject]) -> [SWProperty]? { 103 | var props: [SWProperty] = [] 104 | for (key, value) in dict { 105 | let cl = getClassFromValue(key, value: value) 106 | let prop = SWProperty (name: key, type: cl) 107 | props.append(prop) 108 | } 109 | return props.count > 0 ? props : nil 110 | } 111 | 112 | private func getClassFromValue(key: String, value: AnyObject) -> String { 113 | if value is String { 114 | return "String" 115 | } else if value is Int { 116 | return "Int" 117 | } else if value is Float { 118 | return "Float" 119 | } else if value is Double { 120 | return "Double" 121 | } else if value is [String] { 122 | return "[String]" 123 | } else if value is [Int] { 124 | return "[Int]" 125 | } else if value is [Float] { 126 | return "[Float]" 127 | } else if value is [Double] { 128 | return "[Double]" 129 | } else if value is NSNull { 130 | return "String" 131 | } else if value is [AnyObject] { 132 | // Custom Array 133 | if value.count > 0 { 134 | let serializable = generateSWClass( 135 | fixKey(key), 136 | superName: generatedSWClassSuperName, 137 | dict: value[0] as! [String: AnyObject]) 138 | generatedSWClasses.append(serializable) 139 | } 140 | return "[" + fixKey(key) + "]" 141 | } else { 142 | // Custom Class 143 | let serializable = generateSWClass( 144 | fixKey(key), 145 | superName: generatedSWClassSuperName, 146 | dict: value as! [String: AnyObject]) 147 | generatedSWClasses.append(serializable) 148 | return fixKey(key) 149 | } 150 | } 151 | 152 | private func fixKey(key: String) -> String { 153 | var ns = key as NSString 154 | ns = ns.stringByReplacingOccurrencesOfString("_", withString: " ") 155 | ns = ns.stringByReplacingOccurrencesOfString(" ", withString: "") 156 | let fix = (generatedSWClassPrefix ?? "") + (ns as String) 157 | return fix 158 | } 159 | } 160 | -------------------------------------------------------------------------------- /DeserializableSwiftGenerator/SWProperty.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SWProperty.swift 3 | // DeserializableSwiftGenerator 4 | // 5 | // Created by Cem Olcay on 25/12/14. 6 | // Copyright (c) 2014 Cem Olcay. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | final class SWProperty { 12 | var name: String 13 | var type: String 14 | 15 | init (name: String, type: String) { 16 | self.name = name 17 | self.type = type 18 | } 19 | 20 | func getVariableLine () -> String { 21 | return "var " + name + ": " + type + "?" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /DeserializableSwiftGeneratorTests/DeserializableSwiftGeneratorTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DeserializableSwiftGeneratorTests.swift 3 | // DeserializableSwiftGeneratorTests 4 | // 5 | // Created by Cem Olcay on 14/11/14. 6 | // Copyright (c) 2014 Cem Olcay. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import XCTest 11 | 12 | class DeserializableSwiftGeneratorTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | XCTAssert(true, "Pass") 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measureBlock() { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /DeserializableSwiftGeneratorTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.questa.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2014, Cem Olcay 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a 4 | copy of this software and associated documentation files (the "Software"), 5 | to deal in the Software without restriction, including without limitation 6 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | and/or sell copies of the Software, and to permit persons to whom the 8 | Software is furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 16 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19 | DEALINGS IN THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | DeserializableSwiftGenerator 2 | ============================ 3 | 4 | [JSONHelper](https://github.com/isair/JSONHelper) or [ObjectMapper](https://github.com/Hearst-DD/ObjectMapper) deserializable swift class generator. 5 | 6 | 7 | ![alt tag](https://raw.githubusercontent.com/cemolcay/DeserializableSwiftGenerator/master/ss.png) 8 | 9 | generates deserializable swift classes from json string 10 | 11 | 12 | Usage 13 | ===== 14 | 15 | * JSONHelper
https://github.com/isair/JSONHelper#json-string-deserialization 16 | 17 | * ObjectMapper
https://github.com/Hearst-DD/ObjectMapper#the-basics 18 | 19 | generator creates `JSONHelper` & `ObjectMapper` deserializable swift classes
20 | from your response or request json strings 21 | 22 | 23 | Class Prefixes 24 | -------------- 25 | 26 | If you want to add prefix to your generating classes just add prefix in parenthesis before class name. 27 | ex: (CO)LoginRequest 28 | 29 | 30 | Extending Generator 31 | =================== 32 | 33 | Generator has three main parts behind the scenes: 34 | 35 | **SWJsonParser** 36 | Serializes json string to `SWClass`es 37 | 38 | **SWClass** and **SWProperty** 39 | These are hold the info about generating classes 40 | * class name 41 | * class supername 42 | * class properties 43 | * property name 44 | * property type 45 | 46 | 47 | **SWGenerator** 48 | you can subclass `SWGenerator` with `SWGeneratorProtocol` to create your generator. 49 | 50 | protocol SWGeneratorProtocol { 51 | var deserialzeProtocolName: String? {get} 52 | func generateClassBody (sw: SWClass) -> String 53 | } 54 | 55 | **SWGeneratorView** 56 | this is the ui 57 | you need to add your new generator to `GenerateMethod` enum 58 | 59 | enum GenerateMethod: Int { 60 | case JSONHelper = 0 61 | case ObjectMapper = 1 62 | } 63 | 64 | and lastly update `generate:` method's `switch` statement which initilizes the `SWGenertor` by selection from dropdown menu. 65 | 66 | switch method { 67 | case .JSONHelper: 68 | gen = JSONHelperGenerator () 69 | 70 | case .ObjectMapper: 71 | gen = ObjectMapperGenerator () 72 | } 73 | 74 | -------------------------------------------------------------------------------- /ss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cemolcay/DeserializableSwiftGenerator/fe877b622fb11373f862526967aca65eede4c018/ss.png --------------------------------------------------------------------------------