├── .gitignore ├── nim-ios-demo.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── nim-ios-demo ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── ViewController.h ├── ViewController.m ├── main.m ├── scripts │ └── xcode_prebuild.sh └── src │ └── backend.nim └── nim-ios-demoTests ├── Info.plist └── nim_ios_demoTests.m /.gitignore: -------------------------------------------------------------------------------- 1 | reated by https://www.gitignore.io 2 | 3 | ### Objective-C ### 4 | # Xcode 5 | # 6 | build/ 7 | *.pbxuser 8 | !default.pbxuser 9 | *.mode1v3 10 | !default.mode1v3 11 | *.mode2v3 12 | !default.mode2v3 13 | *.perspectivev3 14 | !default.perspectivev3 15 | xcuserdata 16 | *.xccheckout 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | *.xcuserstate 22 | 23 | # CocoaPods 24 | # 25 | # We recommend against adding the Pods directory to your .gitignore. However 26 | # you should judge for yourself, the pros and cons are mentioned at: 27 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 28 | # 29 | # Pods/ 30 | 31 | 32 | ### Nim ### 33 | nimcache/ 34 | 35 | -------------------------------------------------------------------------------- /nim-ios-demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | E9C729761A77EE3A00803AC5 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E9C729751A77EE3A00803AC5 /* main.m */; }; 11 | E9C729791A77EE3A00803AC5 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E9C729781A77EE3A00803AC5 /* AppDelegate.m */; }; 12 | E9C7297C1A77EE3A00803AC5 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E9C7297B1A77EE3A00803AC5 /* ViewController.m */; }; 13 | E9C7297F1A77EE3A00803AC5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E9C7297D1A77EE3A00803AC5 /* Main.storyboard */; }; 14 | E9C729811A77EE3A00803AC5 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E9C729801A77EE3A00803AC5 /* Images.xcassets */; }; 15 | E9C729841A77EE3A00803AC5 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = E9C729821A77EE3A00803AC5 /* LaunchScreen.xib */; }; 16 | E9C729901A77EE3B00803AC5 /* nim_ios_demoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E9C7298F1A77EE3B00803AC5 /* nim_ios_demoTests.m */; }; 17 | E9C729AA1A77F46000803AC5 /* backend.m in Sources */ = {isa = PBXBuildFile; fileRef = E9C729A71A77F46000803AC5 /* backend.m */; settings = {COMPILER_FLAGS = "-w"; }; }; 18 | E9C729AB1A77F46000803AC5 /* system.m in Sources */ = {isa = PBXBuildFile; fileRef = E9C729A91A77F46000803AC5 /* system.m */; settings = {COMPILER_FLAGS = "-w"; }; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXContainerItemProxy section */ 22 | E9C7298A1A77EE3B00803AC5 /* PBXContainerItemProxy */ = { 23 | isa = PBXContainerItemProxy; 24 | containerPortal = E9C729681A77EE3A00803AC5 /* Project object */; 25 | proxyType = 1; 26 | remoteGlobalIDString = E9C7296F1A77EE3A00803AC5; 27 | remoteInfo = "nim-ios-demo"; 28 | }; 29 | /* End PBXContainerItemProxy section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | E9C729701A77EE3A00803AC5 /* nim-ios-demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "nim-ios-demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | E9C729741A77EE3A00803AC5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 34 | E9C729751A77EE3A00803AC5 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 35 | E9C729771A77EE3A00803AC5 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 36 | E9C729781A77EE3A00803AC5 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 37 | E9C7297A1A77EE3A00803AC5 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 38 | E9C7297B1A77EE3A00803AC5 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 39 | E9C7297E1A77EE3A00803AC5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 40 | E9C729801A77EE3A00803AC5 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 41 | E9C729831A77EE3A00803AC5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 42 | E9C729891A77EE3B00803AC5 /* nim-ios-demoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "nim-ios-demoTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | E9C7298E1A77EE3B00803AC5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 44 | E9C7298F1A77EE3B00803AC5 /* nim_ios_demoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = nim_ios_demoTests.m; sourceTree = ""; }; 45 | E9C7299B1A77F37600803AC5 /* xcode_prebuild.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = xcode_prebuild.sh; sourceTree = ""; }; 46 | E9C7299D1A77F37600803AC5 /* backend.nim */ = {isa = PBXFileReference; lastKnownFileType = text; path = backend.nim; sourceTree = ""; }; 47 | E9C729A01A77F37600803AC5 /* backend.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = backend.h; sourceTree = ""; }; 48 | E9C729A11A77F37600803AC5 /* backend.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = backend.m; sourceTree = ""; }; 49 | E9C729A21A77F37600803AC5 /* nimbase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = nimbase.h; sourceTree = ""; }; 50 | E9C729A31A77F37600803AC5 /* system.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = system.m; sourceTree = ""; }; 51 | E9C729A61A77F46000803AC5 /* backend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = backend.h; sourceTree = ""; }; 52 | E9C729A71A77F46000803AC5 /* backend.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = backend.m; sourceTree = ""; }; 53 | E9C729A81A77F46000803AC5 /* nimbase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nimbase.h; sourceTree = ""; }; 54 | E9C729A91A77F46000803AC5 /* system.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = system.m; sourceTree = ""; }; 55 | /* End PBXFileReference section */ 56 | 57 | /* Begin PBXFrameworksBuildPhase section */ 58 | E9C7296D1A77EE3A00803AC5 /* Frameworks */ = { 59 | isa = PBXFrameworksBuildPhase; 60 | buildActionMask = 2147483647; 61 | files = ( 62 | ); 63 | runOnlyForDeploymentPostprocessing = 0; 64 | }; 65 | E9C729861A77EE3B00803AC5 /* Frameworks */ = { 66 | isa = PBXFrameworksBuildPhase; 67 | buildActionMask = 2147483647; 68 | files = ( 69 | ); 70 | runOnlyForDeploymentPostprocessing = 0; 71 | }; 72 | /* End PBXFrameworksBuildPhase section */ 73 | 74 | /* Begin PBXGroup section */ 75 | E9C729671A77EE3A00803AC5 = { 76 | isa = PBXGroup; 77 | children = ( 78 | E9C729721A77EE3A00803AC5 /* nim-ios-demo */, 79 | E9C7298C1A77EE3B00803AC5 /* nim-ios-demoTests */, 80 | E9C729711A77EE3A00803AC5 /* Products */, 81 | ); 82 | sourceTree = ""; 83 | }; 84 | E9C729711A77EE3A00803AC5 /* Products */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | E9C729701A77EE3A00803AC5 /* nim-ios-demo.app */, 88 | E9C729891A77EE3B00803AC5 /* nim-ios-demoTests.xctest */, 89 | ); 90 | name = Products; 91 | sourceTree = ""; 92 | }; 93 | E9C729721A77EE3A00803AC5 /* nim-ios-demo */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | E9C729A41A77F46000803AC5 /* build */, 97 | E9C7299A1A77F37600803AC5 /* scripts */, 98 | E9C7299C1A77F37600803AC5 /* src */, 99 | E9C729771A77EE3A00803AC5 /* AppDelegate.h */, 100 | E9C729781A77EE3A00803AC5 /* AppDelegate.m */, 101 | E9C7297A1A77EE3A00803AC5 /* ViewController.h */, 102 | E9C7297B1A77EE3A00803AC5 /* ViewController.m */, 103 | E9C7297D1A77EE3A00803AC5 /* Main.storyboard */, 104 | E9C729801A77EE3A00803AC5 /* Images.xcassets */, 105 | E9C729821A77EE3A00803AC5 /* LaunchScreen.xib */, 106 | E9C729731A77EE3A00803AC5 /* Supporting Files */, 107 | ); 108 | path = "nim-ios-demo"; 109 | sourceTree = ""; 110 | }; 111 | E9C729731A77EE3A00803AC5 /* Supporting Files */ = { 112 | isa = PBXGroup; 113 | children = ( 114 | E9C729741A77EE3A00803AC5 /* Info.plist */, 115 | E9C729751A77EE3A00803AC5 /* main.m */, 116 | ); 117 | name = "Supporting Files"; 118 | sourceTree = ""; 119 | }; 120 | E9C7298C1A77EE3B00803AC5 /* nim-ios-demoTests */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | E9C7298F1A77EE3B00803AC5 /* nim_ios_demoTests.m */, 124 | E9C7298D1A77EE3B00803AC5 /* Supporting Files */, 125 | ); 126 | path = "nim-ios-demoTests"; 127 | sourceTree = ""; 128 | }; 129 | E9C7298D1A77EE3B00803AC5 /* Supporting Files */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | E9C7298E1A77EE3B00803AC5 /* Info.plist */, 133 | ); 134 | name = "Supporting Files"; 135 | sourceTree = ""; 136 | }; 137 | E9C7299A1A77F37600803AC5 /* scripts */ = { 138 | isa = PBXGroup; 139 | children = ( 140 | E9C7299B1A77F37600803AC5 /* xcode_prebuild.sh */, 141 | ); 142 | path = scripts; 143 | sourceTree = ""; 144 | }; 145 | E9C7299C1A77F37600803AC5 /* src */ = { 146 | isa = PBXGroup; 147 | children = ( 148 | E9C7299D1A77F37600803AC5 /* backend.nim */, 149 | E9C7299E1A77F37600803AC5 /* build */, 150 | ); 151 | path = src; 152 | sourceTree = ""; 153 | }; 154 | E9C7299E1A77F37600803AC5 /* build */ = { 155 | isa = PBXGroup; 156 | children = ( 157 | E9C7299F1A77F37600803AC5 /* nimcache */, 158 | ); 159 | path = build; 160 | sourceTree = ""; 161 | }; 162 | E9C7299F1A77F37600803AC5 /* nimcache */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | E9C729A01A77F37600803AC5 /* backend.h */, 166 | E9C729A11A77F37600803AC5 /* backend.m */, 167 | E9C729A21A77F37600803AC5 /* nimbase.h */, 168 | E9C729A31A77F37600803AC5 /* system.m */, 169 | ); 170 | path = nimcache; 171 | sourceTree = ""; 172 | }; 173 | E9C729A41A77F46000803AC5 /* build */ = { 174 | isa = PBXGroup; 175 | children = ( 176 | E9C729A51A77F46000803AC5 /* nimcache */, 177 | ); 178 | name = build; 179 | path = src/build; 180 | sourceTree = ""; 181 | }; 182 | E9C729A51A77F46000803AC5 /* nimcache */ = { 183 | isa = PBXGroup; 184 | children = ( 185 | E9C729A61A77F46000803AC5 /* backend.h */, 186 | E9C729A71A77F46000803AC5 /* backend.m */, 187 | E9C729A81A77F46000803AC5 /* nimbase.h */, 188 | E9C729A91A77F46000803AC5 /* system.m */, 189 | ); 190 | path = nimcache; 191 | sourceTree = ""; 192 | }; 193 | /* End PBXGroup section */ 194 | 195 | /* Begin PBXNativeTarget section */ 196 | E9C7296F1A77EE3A00803AC5 /* nim-ios-demo */ = { 197 | isa = PBXNativeTarget; 198 | buildConfigurationList = E9C729931A77EE3B00803AC5 /* Build configuration list for PBXNativeTarget "nim-ios-demo" */; 199 | buildPhases = ( 200 | E9C7296C1A77EE3A00803AC5 /* Sources */, 201 | E9C7296D1A77EE3A00803AC5 /* Frameworks */, 202 | E9C7296E1A77EE3A00803AC5 /* Resources */, 203 | E9C729991A77F14400803AC5 /* ShellScript */, 204 | ); 205 | buildRules = ( 206 | ); 207 | dependencies = ( 208 | ); 209 | name = "nim-ios-demo"; 210 | productName = "nim-ios-demo"; 211 | productReference = E9C729701A77EE3A00803AC5 /* nim-ios-demo.app */; 212 | productType = "com.apple.product-type.application"; 213 | }; 214 | E9C729881A77EE3B00803AC5 /* nim-ios-demoTests */ = { 215 | isa = PBXNativeTarget; 216 | buildConfigurationList = E9C729961A77EE3B00803AC5 /* Build configuration list for PBXNativeTarget "nim-ios-demoTests" */; 217 | buildPhases = ( 218 | E9C729851A77EE3B00803AC5 /* Sources */, 219 | E9C729861A77EE3B00803AC5 /* Frameworks */, 220 | E9C729871A77EE3B00803AC5 /* Resources */, 221 | ); 222 | buildRules = ( 223 | ); 224 | dependencies = ( 225 | E9C7298B1A77EE3B00803AC5 /* PBXTargetDependency */, 226 | ); 227 | name = "nim-ios-demoTests"; 228 | productName = "nim-ios-demoTests"; 229 | productReference = E9C729891A77EE3B00803AC5 /* nim-ios-demoTests.xctest */; 230 | productType = "com.apple.product-type.bundle.unit-test"; 231 | }; 232 | /* End PBXNativeTarget section */ 233 | 234 | /* Begin PBXProject section */ 235 | E9C729681A77EE3A00803AC5 /* Project object */ = { 236 | isa = PBXProject; 237 | attributes = { 238 | LastUpgradeCheck = 0610; 239 | ORGANIZATIONNAME = "Programming Thomas"; 240 | TargetAttributes = { 241 | E9C7296F1A77EE3A00803AC5 = { 242 | CreatedOnToolsVersion = 6.1.1; 243 | }; 244 | E9C729881A77EE3B00803AC5 = { 245 | CreatedOnToolsVersion = 6.1.1; 246 | TestTargetID = E9C7296F1A77EE3A00803AC5; 247 | }; 248 | }; 249 | }; 250 | buildConfigurationList = E9C7296B1A77EE3A00803AC5 /* Build configuration list for PBXProject "nim-ios-demo" */; 251 | compatibilityVersion = "Xcode 3.2"; 252 | developmentRegion = English; 253 | hasScannedForEncodings = 0; 254 | knownRegions = ( 255 | en, 256 | Base, 257 | ); 258 | mainGroup = E9C729671A77EE3A00803AC5; 259 | productRefGroup = E9C729711A77EE3A00803AC5 /* Products */; 260 | projectDirPath = ""; 261 | projectRoot = ""; 262 | targets = ( 263 | E9C7296F1A77EE3A00803AC5 /* nim-ios-demo */, 264 | E9C729881A77EE3B00803AC5 /* nim-ios-demoTests */, 265 | ); 266 | }; 267 | /* End PBXProject section */ 268 | 269 | /* Begin PBXResourcesBuildPhase section */ 270 | E9C7296E1A77EE3A00803AC5 /* Resources */ = { 271 | isa = PBXResourcesBuildPhase; 272 | buildActionMask = 2147483647; 273 | files = ( 274 | E9C7297F1A77EE3A00803AC5 /* Main.storyboard in Resources */, 275 | E9C729841A77EE3A00803AC5 /* LaunchScreen.xib in Resources */, 276 | E9C729811A77EE3A00803AC5 /* Images.xcassets in Resources */, 277 | ); 278 | runOnlyForDeploymentPostprocessing = 0; 279 | }; 280 | E9C729871A77EE3B00803AC5 /* Resources */ = { 281 | isa = PBXResourcesBuildPhase; 282 | buildActionMask = 2147483647; 283 | files = ( 284 | ); 285 | runOnlyForDeploymentPostprocessing = 0; 286 | }; 287 | /* End PBXResourcesBuildPhase section */ 288 | 289 | /* Begin PBXShellScriptBuildPhase section */ 290 | E9C729991A77F14400803AC5 /* ShellScript */ = { 291 | isa = PBXShellScriptBuildPhase; 292 | buildActionMask = 2147483647; 293 | files = ( 294 | ); 295 | inputPaths = ( 296 | ); 297 | outputPaths = ( 298 | ); 299 | runOnlyForDeploymentPostprocessing = 0; 300 | shellPath = /bin/sh; 301 | shellScript = "nim-ios-demo/scripts/xcode_prebuild.sh"; 302 | }; 303 | /* End PBXShellScriptBuildPhase section */ 304 | 305 | /* Begin PBXSourcesBuildPhase section */ 306 | E9C7296C1A77EE3A00803AC5 /* Sources */ = { 307 | isa = PBXSourcesBuildPhase; 308 | buildActionMask = 2147483647; 309 | files = ( 310 | E9C729AA1A77F46000803AC5 /* backend.m in Sources */, 311 | E9C7297C1A77EE3A00803AC5 /* ViewController.m in Sources */, 312 | E9C729791A77EE3A00803AC5 /* AppDelegate.m in Sources */, 313 | E9C729AB1A77F46000803AC5 /* system.m in Sources */, 314 | E9C729761A77EE3A00803AC5 /* main.m in Sources */, 315 | ); 316 | runOnlyForDeploymentPostprocessing = 0; 317 | }; 318 | E9C729851A77EE3B00803AC5 /* Sources */ = { 319 | isa = PBXSourcesBuildPhase; 320 | buildActionMask = 2147483647; 321 | files = ( 322 | E9C729901A77EE3B00803AC5 /* nim_ios_demoTests.m in Sources */, 323 | ); 324 | runOnlyForDeploymentPostprocessing = 0; 325 | }; 326 | /* End PBXSourcesBuildPhase section */ 327 | 328 | /* Begin PBXTargetDependency section */ 329 | E9C7298B1A77EE3B00803AC5 /* PBXTargetDependency */ = { 330 | isa = PBXTargetDependency; 331 | target = E9C7296F1A77EE3A00803AC5 /* nim-ios-demo */; 332 | targetProxy = E9C7298A1A77EE3B00803AC5 /* PBXContainerItemProxy */; 333 | }; 334 | /* End PBXTargetDependency section */ 335 | 336 | /* Begin PBXVariantGroup section */ 337 | E9C7297D1A77EE3A00803AC5 /* Main.storyboard */ = { 338 | isa = PBXVariantGroup; 339 | children = ( 340 | E9C7297E1A77EE3A00803AC5 /* Base */, 341 | ); 342 | name = Main.storyboard; 343 | sourceTree = ""; 344 | }; 345 | E9C729821A77EE3A00803AC5 /* LaunchScreen.xib */ = { 346 | isa = PBXVariantGroup; 347 | children = ( 348 | E9C729831A77EE3A00803AC5 /* Base */, 349 | ); 350 | name = LaunchScreen.xib; 351 | sourceTree = ""; 352 | }; 353 | /* End PBXVariantGroup section */ 354 | 355 | /* Begin XCBuildConfiguration section */ 356 | E9C729911A77EE3B00803AC5 /* Debug */ = { 357 | isa = XCBuildConfiguration; 358 | buildSettings = { 359 | ALWAYS_SEARCH_USER_PATHS = NO; 360 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 361 | CLANG_CXX_LIBRARY = "libc++"; 362 | CLANG_ENABLE_MODULES = YES; 363 | CLANG_ENABLE_OBJC_ARC = YES; 364 | CLANG_WARN_BOOL_CONVERSION = YES; 365 | CLANG_WARN_CONSTANT_CONVERSION = YES; 366 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 367 | CLANG_WARN_EMPTY_BODY = YES; 368 | CLANG_WARN_ENUM_CONVERSION = YES; 369 | CLANG_WARN_INT_CONVERSION = YES; 370 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 371 | CLANG_WARN_UNREACHABLE_CODE = YES; 372 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 373 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 374 | COPY_PHASE_STRIP = NO; 375 | ENABLE_STRICT_OBJC_MSGSEND = YES; 376 | GCC_C_LANGUAGE_STANDARD = gnu99; 377 | GCC_DYNAMIC_NO_PIC = NO; 378 | GCC_OPTIMIZATION_LEVEL = 0; 379 | GCC_PREPROCESSOR_DEFINITIONS = ( 380 | "DEBUG=1", 381 | "$(inherited)", 382 | ); 383 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 384 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 385 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 386 | GCC_WARN_UNDECLARED_SELECTOR = YES; 387 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 388 | GCC_WARN_UNUSED_FUNCTION = YES; 389 | GCC_WARN_UNUSED_VARIABLE = YES; 390 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 391 | MTL_ENABLE_DEBUG_INFO = YES; 392 | ONLY_ACTIVE_ARCH = YES; 393 | SDKROOT = iphoneos; 394 | TARGETED_DEVICE_FAMILY = "1,2"; 395 | }; 396 | name = Debug; 397 | }; 398 | E9C729921A77EE3B00803AC5 /* Release */ = { 399 | isa = XCBuildConfiguration; 400 | buildSettings = { 401 | ALWAYS_SEARCH_USER_PATHS = NO; 402 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 403 | CLANG_CXX_LIBRARY = "libc++"; 404 | CLANG_ENABLE_MODULES = YES; 405 | CLANG_ENABLE_OBJC_ARC = YES; 406 | CLANG_WARN_BOOL_CONVERSION = YES; 407 | CLANG_WARN_CONSTANT_CONVERSION = YES; 408 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 409 | CLANG_WARN_EMPTY_BODY = YES; 410 | CLANG_WARN_ENUM_CONVERSION = YES; 411 | CLANG_WARN_INT_CONVERSION = YES; 412 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 413 | CLANG_WARN_UNREACHABLE_CODE = YES; 414 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 415 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 416 | COPY_PHASE_STRIP = YES; 417 | ENABLE_NS_ASSERTIONS = NO; 418 | ENABLE_STRICT_OBJC_MSGSEND = YES; 419 | GCC_C_LANGUAGE_STANDARD = gnu99; 420 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 421 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 422 | GCC_WARN_UNDECLARED_SELECTOR = YES; 423 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 424 | GCC_WARN_UNUSED_FUNCTION = YES; 425 | GCC_WARN_UNUSED_VARIABLE = YES; 426 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 427 | MTL_ENABLE_DEBUG_INFO = NO; 428 | SDKROOT = iphoneos; 429 | TARGETED_DEVICE_FAMILY = "1,2"; 430 | VALIDATE_PRODUCT = YES; 431 | }; 432 | name = Release; 433 | }; 434 | E9C729941A77EE3B00803AC5 /* Debug */ = { 435 | isa = XCBuildConfiguration; 436 | buildSettings = { 437 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 438 | INFOPLIST_FILE = "nim-ios-demo/Info.plist"; 439 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 440 | PRODUCT_NAME = "$(TARGET_NAME)"; 441 | }; 442 | name = Debug; 443 | }; 444 | E9C729951A77EE3B00803AC5 /* Release */ = { 445 | isa = XCBuildConfiguration; 446 | buildSettings = { 447 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 448 | INFOPLIST_FILE = "nim-ios-demo/Info.plist"; 449 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 450 | PRODUCT_NAME = "$(TARGET_NAME)"; 451 | }; 452 | name = Release; 453 | }; 454 | E9C729971A77EE3B00803AC5 /* Debug */ = { 455 | isa = XCBuildConfiguration; 456 | buildSettings = { 457 | BUNDLE_LOADER = "$(TEST_HOST)"; 458 | FRAMEWORK_SEARCH_PATHS = ( 459 | "$(SDKROOT)/Developer/Library/Frameworks", 460 | "$(inherited)", 461 | ); 462 | GCC_PREPROCESSOR_DEFINITIONS = ( 463 | "DEBUG=1", 464 | "$(inherited)", 465 | ); 466 | INFOPLIST_FILE = "nim-ios-demoTests/Info.plist"; 467 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 468 | PRODUCT_NAME = "$(TARGET_NAME)"; 469 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/nim-ios-demo.app/nim-ios-demo"; 470 | }; 471 | name = Debug; 472 | }; 473 | E9C729981A77EE3B00803AC5 /* Release */ = { 474 | isa = XCBuildConfiguration; 475 | buildSettings = { 476 | BUNDLE_LOADER = "$(TEST_HOST)"; 477 | FRAMEWORK_SEARCH_PATHS = ( 478 | "$(SDKROOT)/Developer/Library/Frameworks", 479 | "$(inherited)", 480 | ); 481 | INFOPLIST_FILE = "nim-ios-demoTests/Info.plist"; 482 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 483 | PRODUCT_NAME = "$(TARGET_NAME)"; 484 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/nim-ios-demo.app/nim-ios-demo"; 485 | }; 486 | name = Release; 487 | }; 488 | /* End XCBuildConfiguration section */ 489 | 490 | /* Begin XCConfigurationList section */ 491 | E9C7296B1A77EE3A00803AC5 /* Build configuration list for PBXProject "nim-ios-demo" */ = { 492 | isa = XCConfigurationList; 493 | buildConfigurations = ( 494 | E9C729911A77EE3B00803AC5 /* Debug */, 495 | E9C729921A77EE3B00803AC5 /* Release */, 496 | ); 497 | defaultConfigurationIsVisible = 0; 498 | defaultConfigurationName = Release; 499 | }; 500 | E9C729931A77EE3B00803AC5 /* Build configuration list for PBXNativeTarget "nim-ios-demo" */ = { 501 | isa = XCConfigurationList; 502 | buildConfigurations = ( 503 | E9C729941A77EE3B00803AC5 /* Debug */, 504 | E9C729951A77EE3B00803AC5 /* Release */, 505 | ); 506 | defaultConfigurationIsVisible = 0; 507 | }; 508 | E9C729961A77EE3B00803AC5 /* Build configuration list for PBXNativeTarget "nim-ios-demoTests" */ = { 509 | isa = XCConfigurationList; 510 | buildConfigurations = ( 511 | E9C729971A77EE3B00803AC5 /* Debug */, 512 | E9C729981A77EE3B00803AC5 /* Release */, 513 | ); 514 | defaultConfigurationIsVisible = 0; 515 | }; 516 | /* End XCConfigurationList section */ 517 | }; 518 | rootObject = E9C729681A77EE3A00803AC5 /* Project object */; 519 | } 520 | -------------------------------------------------------------------------------- /nim-ios-demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /nim-ios-demo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // nim-ios-demo 4 | // 5 | // Created by Thomas Denney on 27/01/2015. 6 | // Copyright (c) 2015 Programming Thomas. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /nim-ios-demo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // nim-ios-demo 4 | // 5 | // Created by Thomas Denney on 27/01/2015. 6 | // Copyright (c) 2015 Programming Thomas. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /nim-ios-demo/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /nim-ios-demo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 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 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /nim-ios-demo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /nim-ios-demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.programmingthomas.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /nim-ios-demo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // nim-ios-demo 4 | // 5 | // Created by Thomas Denney on 27/01/2015. 6 | // Copyright (c) 2015 Programming Thomas. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /nim-ios-demo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // nim-ios-demo 4 | // 5 | // Created by Thomas Denney on 27/01/2015. 6 | // Copyright (c) 2015 Programming Thomas. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "backend.h" 11 | 12 | @interface ViewController () 13 | - (IBAction)textChanged:(UITextField *)sender; 14 | @property (weak, nonatomic) IBOutlet UILabel *label; 15 | 16 | @end 17 | 18 | @implementation ViewController 19 | 20 | - (IBAction)textChanged:(UITextField *)sender { 21 | char * helloName = hello((char*)sender.text.UTF8String); 22 | self.label.text = [NSString stringWithUTF8String:helloName]; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /nim-ios-demo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // nim-ios-demo 4 | // 5 | // Created by Thomas Denney on 27/01/2015. 6 | // Copyright (c) 2015 Programming Thomas. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | #import "backend.h" 12 | 13 | int main(int argc, char * argv[]) { 14 | @autoreleasepool { 15 | NimMain(); 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /nim-ios-demo/scripts/xcode_prebuild.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This script is based on the one in https://github.com/gradha/nimrod-on-ios 4 | # with additional work by Thomas Denney in order to support both 32-bit and 5 | # 64-bit iOS devices. Please note that Xcode will produce a lot of warnings for 6 | # the .h and .m files that this generates. If you want to avoid these, add the 7 | # '-w' flag to each of the files' build phase. 8 | 9 | # Basically this script builds separate .h/.m files for 32-bit and 64-bit 10 | # targets and then joins them together using compiler macros. 11 | 12 | # To use this script: 13 | 14 | # * Modify the PATH_TO_NIM below 15 | # * Create a 'src' directory inside your project. This will be where you store 16 | # your .nim source files 17 | # * Create a 'scripts' directory inside your project, at the same level as the 18 | # 'src' directory. Add this script to that directory. Add a run script build 19 | # phase for this script 20 | # * Add your nim files to the src directory and do CMD+B. Make sure they aren't 21 | # a member of the project target otherwise Xcode will try to build them with 22 | # clang. 23 | # * Add the build/nimcache directory to your project. This contains the output 24 | # .h and .m files 25 | # * Include the appropriate headers in your Objective-C source 26 | 27 | # N.B. Use NSInteger, not int! 28 | 29 | # Set this to the path of your Nim directory. This should be the path that 30 | # contains the bin/ and lib/ directories. 31 | PATH_TO_NIM=~/Downloads/nim-0.10.2/ 32 | 33 | # Set this to the name of the project. 34 | PROJECT_DIR=nim-ios-demo 35 | 36 | # Path of the actual Nim compiler 37 | PATH_TO_NIM_COMPILER=$PATH_TO_NIM"bin/nim" 38 | PATH_TO_NIMBASE=$PATH_TO_NIM"lib/nimbase.h" 39 | 40 | # Force errors to fail script. 41 | set -e 42 | 43 | # If we are running from inside the scripts subdir, get out. 44 | if [ ! -d $PROJECT_DIR/src ] 45 | then 46 | cd .. 47 | fi 48 | 49 | cd $PROJECT_DIR 50 | 51 | DEST_NIMBASE=src/build/nimcache/nimbase.h 52 | 53 | # Ok, are we out now? 54 | if [ -d src ] 55 | then 56 | # Compile the 32-bit code. There are minor differences 57 | # between the two 58 | $PATH_TO_NIM_COMPILER objc --noMain --app:lib \ 59 | --cpu:i386 --nimcache:build/nimcache32 --compileOnly \ 60 | --header src/*.nim 61 | # Compile 64-bit code 62 | $PATH_TO_NIM_COMPILER objc --noMain --app:lib \ 63 | --cpu:amd64 --nimcache:build/nimcache64 --compileOnly \ 64 | --header src/*.nim 65 | 66 | mkdir -p src/build/nimcache 67 | 68 | FILES=src/build/nimcache32/* 69 | for source in $FILES 70 | do 71 | # And now for the hack of the year! 72 | # We take the two files in the 32-bit and 64-bit directory 73 | # and concatenate them, but inserting the appropriate IFDEF 74 | # for separate 32-bit and 64-bit code. This means that we can 75 | # easily build for both platforms. 76 | b=$(basename $source) 77 | dst="src/build/nimcache/$b" 78 | echo "#if __LP64__ || (TARGET_OS_EMBEDDED && !TARGET_OS_IPHONE) || TARGET_OS_WIN32 || NS_BUILD_32_LIKE_64" > $dst 79 | cat "src/build/nimcache64/$b" >> $dst 80 | echo "#else" >> $dst 81 | cat $source >> $dst 82 | echo "#endif" >> $dst 83 | done 84 | 85 | # Cleanup, don't need to keep the nimcache32/nimcache64 files 86 | rm -R src/build/nimcache32 87 | rm -R src/build/nimcache64 88 | 89 | # Copy nimbase.h. This is platform neutral 90 | if [ "${PATH_TO_NIMBASE}" -nt "${DEST_NIMBASE}" ] 91 | then 92 | echo "Updating nimbase.h" 93 | cp "${PATH_TO_NIMBASE}" "${DEST_NIMBASE}" 94 | fi 95 | else 96 | echo "Uh oh, src directory not found? $(pwd)" 97 | exit 1 98 | fi 99 | -------------------------------------------------------------------------------- /nim-ios-demo/src/backend.nim: -------------------------------------------------------------------------------- 1 | proc hello*(name: cstring): cstring {.exportc.} = 2 | result = "Hello " & $name -------------------------------------------------------------------------------- /nim-ios-demoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.programmingthomas.$(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 | -------------------------------------------------------------------------------- /nim-ios-demoTests/nim_ios_demoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // nim_ios_demoTests.m 3 | // nim-ios-demoTests 4 | // 5 | // Created by Thomas Denney on 27/01/2015. 6 | // Copyright (c) 2015 Programming Thomas. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface nim_ios_demoTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation nim_ios_demoTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | --------------------------------------------------------------------------------