├── .gitignore ├── README.md ├── Rust ├── Makefile ├── objcrust.h └── objcrust.rs └── iOS ├── ObjCrust.xcodeproj └── project.pbxproj ├── Resources ├── Images │ ├── Default-568h@2x.png │ ├── Default-Landscape.png │ ├── Default-Landscape@2x.png │ ├── Default-Portrait.png │ ├── Default-Portrait@2x.png │ ├── Default.png │ ├── Default@2x.png │ ├── Icon-ipad.png │ ├── Icon-ipad@2x.png │ ├── Icon.png │ ├── Icon@2x.png │ ├── iTunesArtwork │ └── iTunesArtwork@2x ├── Info.plist └── Localized │ └── en.lproj │ ├── InfoPlist.strings │ └── Localizable.strings ├── Sources ├── CRAppDelegate.h ├── CRAppDelegate.m ├── CRViewController.h ├── CRViewController.m └── main.m └── Tests ├── TestRust.m └── TestsInfo.plist /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | project.xcworkspace 14 | *.xccheckout 15 | profile 16 | *.moved-aside 17 | DerivedData 18 | .idea/ 19 | Rust/*.[ao] 20 | Rust/*.bc 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ObjCrust 2 | 3 | A proof of concept for using Rust to create an iOS static library. 4 | 5 | Requires Xcode 5 and the iOS 7 SDK. 6 | 7 | Based on [doublec/rust-from-c-example](https://github.com/doublec/rust-from-c-example) 8 | 9 | 10 | ## Status 11 | 12 | What works: 13 | 14 | - Rust code exposes simple functions for working with integers and floats, using values, pointers and structs. 15 | - Make file creates architecture-specific libraries for the simulator (`i386`) and devices (`armv7` and `armv7s`). 16 | - Creates universal static library for linking in iOS binary. 17 | - iOS project builds and runs on simulator and devices. 18 | 19 | What doesn't work: 20 | 21 | - Compiles without standard library (maybe try with rust-core?) 22 | - When running on Simulator: Functions that return structs with float members cause a crash (maybe related to [issue #5744](https://github.com/mozilla/rust/issues/5744)?) 23 | 24 | 25 | ## Usage 26 | 27 | 1. `git clone https://github.com/shilgapira/ObjCrust.git` 28 | 2. `cd ObjCrust/Rust` 29 | 3. `make` 30 | 4. `cd ../iOS` 31 | 5. `open ObjCrust.xcodeproj` 32 | 6. Build and run in Xcode 33 | -------------------------------------------------------------------------------- /Rust/Makefile: -------------------------------------------------------------------------------- 1 | all: libobjcrust.a 2 | 3 | bytecodes: objcrust.rs 4 | rustc --emit=bc --target i386-apple-darwin objcrust.rs 5 | mv objcrust.bc objcrust-i386.bc 6 | rustc --emit=bc --target armv7-apple-darwin objcrust.rs 7 | mv objcrust.bc objcrust-armv7.bc 8 | rustc --emit=bc --target armv7s-apple-darwin objcrust.rs 9 | mv objcrust.bc objcrust-armv7s.bc 10 | 11 | objects: bytecodes 12 | clang -arch i386 -c objcrust-i386.bc 13 | clang -arch armv7 -c objcrust-armv7.bc 14 | clang -arch armv7s -c objcrust-armv7s.bc 15 | 16 | libraries: objects 17 | ar -cr objcrust-i386.a objcrust-i386.o 18 | ar -cr objcrust-armv7.a objcrust-armv7.o 19 | ar -cr objcrust-armv7s.a objcrust-armv7s.o 20 | 21 | libobjcrust.a: libraries 22 | lipo -create -output libobjcrust.a objcrust-i386.a objcrust-armv7.a objcrust-armv7s.a 23 | 24 | clean: 25 | rm -f *.bc *.o *.a 26 | -------------------------------------------------------------------------------- /Rust/objcrust.h: -------------------------------------------------------------------------------- 1 | 2 | #import 3 | 4 | 5 | typedef struct { 6 | unsigned foo; 7 | unsigned bar; 8 | } Pair; 9 | 10 | 11 | typedef struct { 12 | double real; 13 | double img; 14 | } Complex; 15 | 16 | 17 | extern unsigned get_num(); 18 | 19 | extern double get_float(); 20 | 21 | extern unsigned inc_num(unsigned num); 22 | 23 | extern unsigned add_nums(unsigned num1, unsigned num2); 24 | 25 | extern unsigned get_num_ptr(unsigned *num); 26 | 27 | extern unsigned inc_num_ptr(unsigned *num); 28 | 29 | extern double inc_float_ptr(double *num); 30 | 31 | extern Pair get_pair(); 32 | 33 | extern Pair inc_pair(Pair pair); 34 | 35 | extern Pair inc_pair_ptr(Pair *pair); 36 | 37 | extern Complex get_complex(); 38 | 39 | extern Complex inc_complex(Complex complex); 40 | 41 | extern void inc_complex_ptr(Complex *complex); 42 | -------------------------------------------------------------------------------- /Rust/objcrust.rs: -------------------------------------------------------------------------------- 1 | #![crate_type = "lib"] 2 | #![no_std] 3 | #![allow(ctypes)] 4 | 5 | 6 | pub struct Pair { 7 | foo: uint, 8 | bar: uint, 9 | } 10 | 11 | pub struct Complex { 12 | real: f64, 13 | img: f64, 14 | } 15 | 16 | #[no_mangle] 17 | pub extern fn get_num() -> uint { 18 | 42 19 | } 20 | 21 | #[no_mangle] 22 | pub extern fn get_float() -> f64 { 23 | 42.42 24 | } 25 | 26 | #[no_mangle] 27 | pub extern fn inc_num(num: uint) -> uint { 28 | num + 1 29 | } 30 | 31 | #[no_mangle] 32 | pub extern fn add_nums(num1: uint, num2: uint) -> uint { 33 | num1 + num2 34 | } 35 | 36 | #[no_mangle] 37 | pub extern fn get_num_ptr(num: &uint) -> uint { 38 | *num 39 | } 40 | 41 | #[no_mangle] 42 | pub extern fn inc_num_ptr(num: &mut uint) -> uint { 43 | *num += 1; 44 | *num 45 | } 46 | 47 | #[no_mangle] 48 | pub extern fn inc_float_ptr(num: &mut f64) -> f64 { 49 | *num += 1.0; 50 | *num 51 | } 52 | 53 | #[no_mangle] 54 | pub extern fn get_pair() -> Pair { 55 | Pair { 56 | foo: 42, 57 | bar: 10, 58 | } 59 | } 60 | 61 | #[no_mangle] 62 | pub extern fn inc_pair(pair: Pair) -> Pair { 63 | Pair { 64 | foo: pair.foo + 1, 65 | bar: pair.bar + 1, 66 | } 67 | } 68 | 69 | #[no_mangle] 70 | pub extern fn inc_pair_ptr(pair: &mut Pair) -> Pair { 71 | pair.foo += 1; 72 | pair.bar += 1; 73 | *pair 74 | } 75 | 76 | #[no_mangle] 77 | pub extern fn get_complex() -> Complex { 78 | Complex { 79 | real: 10.0, 80 | img: 42.0, 81 | } 82 | } 83 | 84 | #[no_mangle] 85 | pub extern fn inc_complex(comp: Complex) -> Complex { 86 | Complex { 87 | real: comp.real + 1.0, 88 | img: comp.img + 1.0, 89 | } 90 | } 91 | 92 | #[no_mangle] 93 | pub extern fn inc_complex_ptr(comp: &mut Complex) { 94 | comp.real += 1.0; 95 | comp.img += 1.0; 96 | } 97 | -------------------------------------------------------------------------------- /iOS/ObjCrust.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 2B1CEE5C177C924700AE7D4A /* Default-Landscape.png in Resources */ = {isa = PBXBuildFile; fileRef = 2B1CEE54177C924700AE7D4A /* Default-Landscape.png */; }; 11 | 2B1CEE5D177C924700AE7D4A /* Default-Landscape@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 2B1CEE55177C924700AE7D4A /* Default-Landscape@2x.png */; }; 12 | 2B1CEE5E177C924700AE7D4A /* Default-Portrait.png in Resources */ = {isa = PBXBuildFile; fileRef = 2B1CEE56177C924700AE7D4A /* Default-Portrait.png */; }; 13 | 2B1CEE5F177C924700AE7D4A /* Default-Portrait@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 2B1CEE57177C924700AE7D4A /* Default-Portrait@2x.png */; }; 14 | 2B1CEE60177C924700AE7D4A /* Icon-ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 2B1CEE58177C924700AE7D4A /* Icon-ipad.png */; }; 15 | 2B1CEE61177C924700AE7D4A /* Icon-ipad@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 2B1CEE59177C924700AE7D4A /* Icon-ipad@2x.png */; }; 16 | 2B1CEE62177C924700AE7D4A /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 2B1CEE5A177C924700AE7D4A /* Icon.png */; }; 17 | 2B1CEE63177C924700AE7D4A /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 2B1CEE5B177C924700AE7D4A /* Icon@2x.png */; }; 18 | 2B391BC11778CEFF00FF53E7 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2B391BBF1778CEC800FF53E7 /* Localizable.strings */; }; 19 | 2B391BC21778CF0200FF53E7 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2B391BBD1778CEC800FF53E7 /* InfoPlist.strings */; }; 20 | 2B43BA7A187F56C20063A594 /* libobjcrust.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2B43BA79187F56C20063A594 /* libobjcrust.a */; }; 21 | 2B43BA80187FD2FA0063A594 /* CRViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B43BA7F187FD2FA0063A594 /* CRViewController.m */; }; 22 | 2B7326B31778B13900BE08F9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B7326B21778B13900BE08F9 /* main.m */; }; 23 | 2B7326B71778B13900BE08F9 /* CRAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B7326B61778B13900BE08F9 /* CRAppDelegate.m */; }; 24 | 2B7326B91778B13900BE08F9 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 2B7326B81778B13900BE08F9 /* Default.png */; }; 25 | 2B7326BB1778B13900BE08F9 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 2B7326BA1778B13900BE08F9 /* Default@2x.png */; }; 26 | 2B7326BD1778B13900BE08F9 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 2B7326BC1778B13900BE08F9 /* Default-568h@2x.png */; }; 27 | 2B7326C51778B13900BE08F9 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2B7326C41778B13900BE08F9 /* SenTestingKit.framework */; }; 28 | 2B8D5136184B599800A0D6A5 /* TestRust.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B8D5135184B599800A0D6A5 /* TestRust.m */; }; 29 | /* End PBXBuildFile section */ 30 | 31 | /* Begin PBXContainerItemProxy section */ 32 | 2B7326C81778B13900BE08F9 /* PBXContainerItemProxy */ = { 33 | isa = PBXContainerItemProxy; 34 | containerPortal = 2B73269B1778B13800BE08F9 /* Project object */; 35 | proxyType = 1; 36 | remoteGlobalIDString = 2B7326A21778B13900BE08F9; 37 | remoteInfo = ObjCrust; 38 | }; 39 | /* End PBXContainerItemProxy section */ 40 | 41 | /* Begin PBXFileReference section */ 42 | 2B1CEE54177C924700AE7D4A /* Default-Landscape.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape.png"; sourceTree = ""; }; 43 | 2B1CEE55177C924700AE7D4A /* Default-Landscape@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Landscape@2x.png"; sourceTree = ""; }; 44 | 2B1CEE56177C924700AE7D4A /* Default-Portrait.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Portrait.png"; sourceTree = ""; }; 45 | 2B1CEE57177C924700AE7D4A /* Default-Portrait@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-Portrait@2x.png"; sourceTree = ""; }; 46 | 2B1CEE58177C924700AE7D4A /* Icon-ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-ipad.png"; sourceTree = ""; }; 47 | 2B1CEE59177C924700AE7D4A /* Icon-ipad@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-ipad@2x.png"; sourceTree = ""; }; 48 | 2B1CEE5A177C924700AE7D4A /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = ""; }; 49 | 2B1CEE5B177C924700AE7D4A /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon@2x.png"; sourceTree = ""; }; 50 | 2B391BBE1778CEC800FF53E7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 51 | 2B391BC01778CEC800FF53E7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; 52 | 2B391BC61778D0CC00FF53E7 /* TestsInfo.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = TestsInfo.plist; sourceTree = ""; }; 53 | 2B43BA79187F56C20063A594 /* libobjcrust.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libobjcrust.a; sourceTree = ""; }; 54 | 2B43BA7B187F58080063A594 /* objcrust.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = objcrust.h; sourceTree = ""; }; 55 | 2B43BA7C187FCEEB0063A594 /* objcrust.rs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = objcrust.rs; sourceTree = ""; }; 56 | 2B43BA7E187FD2FA0063A594 /* CRViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CRViewController.h; sourceTree = ""; }; 57 | 2B43BA7F187FD2FA0063A594 /* CRViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CRViewController.m; sourceTree = ""; }; 58 | 2B7326A31778B13900BE08F9 /* ObjCrust.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ObjCrust.app; sourceTree = BUILT_PRODUCTS_DIR; }; 59 | 2B7326AE1778B13900BE08F9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 60 | 2B7326B21778B13900BE08F9 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 61 | 2B7326B51778B13900BE08F9 /* CRAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CRAppDelegate.h; sourceTree = ""; }; 62 | 2B7326B61778B13900BE08F9 /* CRAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CRAppDelegate.m; sourceTree = ""; }; 63 | 2B7326B81778B13900BE08F9 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; 64 | 2B7326BA1778B13900BE08F9 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; 65 | 2B7326BC1778B13900BE08F9 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 66 | 2B7326C31778B13900BE08F9 /* Unit Tests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Unit Tests.octest"; sourceTree = BUILT_PRODUCTS_DIR; }; 67 | 2B7326C41778B13900BE08F9 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; 68 | 2B8D5135184B599800A0D6A5 /* TestRust.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestRust.m; sourceTree = ""; }; 69 | /* End PBXFileReference section */ 70 | 71 | /* Begin PBXFrameworksBuildPhase section */ 72 | 2B7326A01778B13900BE08F9 /* Frameworks */ = { 73 | isa = PBXFrameworksBuildPhase; 74 | buildActionMask = 2147483647; 75 | files = ( 76 | 2B43BA7A187F56C20063A594 /* libobjcrust.a in Frameworks */, 77 | ); 78 | runOnlyForDeploymentPostprocessing = 0; 79 | }; 80 | 2B7326BF1778B13900BE08F9 /* Frameworks */ = { 81 | isa = PBXFrameworksBuildPhase; 82 | buildActionMask = 2147483647; 83 | files = ( 84 | 2B7326C51778B13900BE08F9 /* SenTestingKit.framework in Frameworks */, 85 | ); 86 | runOnlyForDeploymentPostprocessing = 0; 87 | }; 88 | /* End PBXFrameworksBuildPhase section */ 89 | 90 | /* Begin PBXGroup section */ 91 | 2B391BB71778C81100FF53E7 /* Resources */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | 2B7326AE1778B13900BE08F9 /* Info.plist */, 95 | 2B391BBC1778CEA800FF53E7 /* Localized */, 96 | 2B391BBB1778C97400FF53E7 /* Images */, 97 | ); 98 | path = Resources; 99 | sourceTree = ""; 100 | }; 101 | 2B391BBB1778C97400FF53E7 /* Images */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 2B1CEE5A177C924700AE7D4A /* Icon.png */, 105 | 2B1CEE5B177C924700AE7D4A /* Icon@2x.png */, 106 | 2B1CEE58177C924700AE7D4A /* Icon-ipad.png */, 107 | 2B1CEE59177C924700AE7D4A /* Icon-ipad@2x.png */, 108 | 2B7326B81778B13900BE08F9 /* Default.png */, 109 | 2B7326BA1778B13900BE08F9 /* Default@2x.png */, 110 | 2B7326BC1778B13900BE08F9 /* Default-568h@2x.png */, 111 | 2B1CEE54177C924700AE7D4A /* Default-Landscape.png */, 112 | 2B1CEE55177C924700AE7D4A /* Default-Landscape@2x.png */, 113 | 2B1CEE56177C924700AE7D4A /* Default-Portrait.png */, 114 | 2B1CEE57177C924700AE7D4A /* Default-Portrait@2x.png */, 115 | ); 116 | path = Images; 117 | sourceTree = ""; 118 | }; 119 | 2B391BBC1778CEA800FF53E7 /* Localized */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 2B391BBD1778CEC800FF53E7 /* InfoPlist.strings */, 123 | 2B391BBF1778CEC800FF53E7 /* Localizable.strings */, 124 | ); 125 | path = Localized; 126 | sourceTree = ""; 127 | }; 128 | 2B73269A1778B13800BE08F9 = { 129 | isa = PBXGroup; 130 | children = ( 131 | 2B7326AC1778B13900BE08F9 /* Sources */, 132 | 2BC80FD617796F520048FC53 /* Rust */, 133 | 2B391BB71778C81100FF53E7 /* Resources */, 134 | 2B7326CA1778B13900BE08F9 /* Tests */, 135 | 2B7326A41778B13900BE08F9 /* Products */, 136 | ); 137 | sourceTree = ""; 138 | }; 139 | 2B7326A41778B13900BE08F9 /* Products */ = { 140 | isa = PBXGroup; 141 | children = ( 142 | 2B7326A31778B13900BE08F9 /* ObjCrust.app */, 143 | 2B7326C31778B13900BE08F9 /* Unit Tests.octest */, 144 | ); 145 | name = Products; 146 | sourceTree = ""; 147 | }; 148 | 2B7326AC1778B13900BE08F9 /* Sources */ = { 149 | isa = PBXGroup; 150 | children = ( 151 | 2B7326B21778B13900BE08F9 /* main.m */, 152 | 2B7326B51778B13900BE08F9 /* CRAppDelegate.h */, 153 | 2B7326B61778B13900BE08F9 /* CRAppDelegate.m */, 154 | 2B43BA7E187FD2FA0063A594 /* CRViewController.h */, 155 | 2B43BA7F187FD2FA0063A594 /* CRViewController.m */, 156 | ); 157 | path = Sources; 158 | sourceTree = ""; 159 | }; 160 | 2B7326CA1778B13900BE08F9 /* Tests */ = { 161 | isa = PBXGroup; 162 | children = ( 163 | 2B8D5135184B599800A0D6A5 /* TestRust.m */, 164 | 2B391BC61778D0CC00FF53E7 /* TestsInfo.plist */, 165 | 2B7326C41778B13900BE08F9 /* SenTestingKit.framework */, 166 | ); 167 | path = Tests; 168 | sourceTree = ""; 169 | }; 170 | 2BC80FD617796F520048FC53 /* Rust */ = { 171 | isa = PBXGroup; 172 | children = ( 173 | 2B43BA7B187F58080063A594 /* objcrust.h */, 174 | 2B43BA7C187FCEEB0063A594 /* objcrust.rs */, 175 | 2B43BA79187F56C20063A594 /* libobjcrust.a */, 176 | ); 177 | name = Rust; 178 | path = ../Rust; 179 | sourceTree = ""; 180 | }; 181 | /* End PBXGroup section */ 182 | 183 | /* Begin PBXNativeTarget section */ 184 | 2B7326A21778B13900BE08F9 /* ObjCrust */ = { 185 | isa = PBXNativeTarget; 186 | buildConfigurationList = 2B7326D51778B13900BE08F9 /* Build configuration list for PBXNativeTarget "ObjCrust" */; 187 | buildPhases = ( 188 | 2B73269F1778B13900BE08F9 /* Sources */, 189 | 2B7326A01778B13900BE08F9 /* Frameworks */, 190 | 2B7326A11778B13900BE08F9 /* Resources */, 191 | ); 192 | buildRules = ( 193 | ); 194 | dependencies = ( 195 | ); 196 | name = ObjCrust; 197 | productName = ObjCrust; 198 | productReference = 2B7326A31778B13900BE08F9 /* ObjCrust.app */; 199 | productType = "com.apple.product-type.application"; 200 | }; 201 | 2B7326C21778B13900BE08F9 /* Unit Tests */ = { 202 | isa = PBXNativeTarget; 203 | buildConfigurationList = 2B7326D81778B13900BE08F9 /* Build configuration list for PBXNativeTarget "Unit Tests" */; 204 | buildPhases = ( 205 | 2B7326BE1778B13900BE08F9 /* Sources */, 206 | 2B7326BF1778B13900BE08F9 /* Frameworks */, 207 | 2B7326C01778B13900BE08F9 /* Resources */, 208 | 2B7326C11778B13900BE08F9 /* ShellScript */, 209 | ); 210 | buildRules = ( 211 | ); 212 | dependencies = ( 213 | 2B7326C91778B13900BE08F9 /* PBXTargetDependency */, 214 | ); 215 | name = "Unit Tests"; 216 | productName = ObjCrustTests; 217 | productReference = 2B7326C31778B13900BE08F9 /* Unit Tests.octest */; 218 | productType = "com.apple.product-type.bundle"; 219 | }; 220 | /* End PBXNativeTarget section */ 221 | 222 | /* Begin PBXProject section */ 223 | 2B73269B1778B13800BE08F9 /* Project object */ = { 224 | isa = PBXProject; 225 | attributes = { 226 | CLASSPREFIX = CR; 227 | LastUpgradeCheck = 0460; 228 | ORGANIZATIONNAME = "Gil Shapira"; 229 | }; 230 | buildConfigurationList = 2B73269E1778B13800BE08F9 /* Build configuration list for PBXProject "ObjCrust" */; 231 | compatibilityVersion = "Xcode 3.2"; 232 | developmentRegion = English; 233 | hasScannedForEncodings = 0; 234 | knownRegions = ( 235 | en, 236 | ); 237 | mainGroup = 2B73269A1778B13800BE08F9; 238 | productRefGroup = 2B7326A41778B13900BE08F9 /* Products */; 239 | projectDirPath = ""; 240 | projectRoot = ""; 241 | targets = ( 242 | 2B7326A21778B13900BE08F9 /* ObjCrust */, 243 | 2B7326C21778B13900BE08F9 /* Unit Tests */, 244 | ); 245 | }; 246 | /* End PBXProject section */ 247 | 248 | /* Begin PBXResourcesBuildPhase section */ 249 | 2B7326A11778B13900BE08F9 /* Resources */ = { 250 | isa = PBXResourcesBuildPhase; 251 | buildActionMask = 2147483647; 252 | files = ( 253 | 2B391BC11778CEFF00FF53E7 /* Localizable.strings in Resources */, 254 | 2B391BC21778CF0200FF53E7 /* InfoPlist.strings in Resources */, 255 | 2B7326B91778B13900BE08F9 /* Default.png in Resources */, 256 | 2B7326BB1778B13900BE08F9 /* Default@2x.png in Resources */, 257 | 2B7326BD1778B13900BE08F9 /* Default-568h@2x.png in Resources */, 258 | 2B1CEE5C177C924700AE7D4A /* Default-Landscape.png in Resources */, 259 | 2B1CEE5D177C924700AE7D4A /* Default-Landscape@2x.png in Resources */, 260 | 2B1CEE5E177C924700AE7D4A /* Default-Portrait.png in Resources */, 261 | 2B1CEE5F177C924700AE7D4A /* Default-Portrait@2x.png in Resources */, 262 | 2B1CEE60177C924700AE7D4A /* Icon-ipad.png in Resources */, 263 | 2B1CEE61177C924700AE7D4A /* Icon-ipad@2x.png in Resources */, 264 | 2B1CEE62177C924700AE7D4A /* Icon.png in Resources */, 265 | 2B1CEE63177C924700AE7D4A /* Icon@2x.png in Resources */, 266 | ); 267 | runOnlyForDeploymentPostprocessing = 0; 268 | }; 269 | 2B7326C01778B13900BE08F9 /* Resources */ = { 270 | isa = PBXResourcesBuildPhase; 271 | buildActionMask = 2147483647; 272 | files = ( 273 | ); 274 | runOnlyForDeploymentPostprocessing = 0; 275 | }; 276 | /* End PBXResourcesBuildPhase section */ 277 | 278 | /* Begin PBXShellScriptBuildPhase section */ 279 | 2B7326C11778B13900BE08F9 /* ShellScript */ = { 280 | isa = PBXShellScriptBuildPhase; 281 | buildActionMask = 2147483647; 282 | files = ( 283 | ); 284 | inputPaths = ( 285 | ); 286 | outputPaths = ( 287 | ); 288 | runOnlyForDeploymentPostprocessing = 0; 289 | shellPath = /bin/sh; 290 | shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; 291 | }; 292 | /* End PBXShellScriptBuildPhase section */ 293 | 294 | /* Begin PBXSourcesBuildPhase section */ 295 | 2B73269F1778B13900BE08F9 /* Sources */ = { 296 | isa = PBXSourcesBuildPhase; 297 | buildActionMask = 2147483647; 298 | files = ( 299 | 2B43BA80187FD2FA0063A594 /* CRViewController.m in Sources */, 300 | 2B7326B31778B13900BE08F9 /* main.m in Sources */, 301 | 2B7326B71778B13900BE08F9 /* CRAppDelegate.m in Sources */, 302 | ); 303 | runOnlyForDeploymentPostprocessing = 0; 304 | }; 305 | 2B7326BE1778B13900BE08F9 /* Sources */ = { 306 | isa = PBXSourcesBuildPhase; 307 | buildActionMask = 2147483647; 308 | files = ( 309 | 2B8D5136184B599800A0D6A5 /* TestRust.m in Sources */, 310 | ); 311 | runOnlyForDeploymentPostprocessing = 0; 312 | }; 313 | /* End PBXSourcesBuildPhase section */ 314 | 315 | /* Begin PBXTargetDependency section */ 316 | 2B7326C91778B13900BE08F9 /* PBXTargetDependency */ = { 317 | isa = PBXTargetDependency; 318 | target = 2B7326A21778B13900BE08F9 /* ObjCrust */; 319 | targetProxy = 2B7326C81778B13900BE08F9 /* PBXContainerItemProxy */; 320 | }; 321 | /* End PBXTargetDependency section */ 322 | 323 | /* Begin PBXVariantGroup section */ 324 | 2B391BBD1778CEC800FF53E7 /* InfoPlist.strings */ = { 325 | isa = PBXVariantGroup; 326 | children = ( 327 | 2B391BBE1778CEC800FF53E7 /* en */, 328 | ); 329 | name = InfoPlist.strings; 330 | sourceTree = ""; 331 | }; 332 | 2B391BBF1778CEC800FF53E7 /* Localizable.strings */ = { 333 | isa = PBXVariantGroup; 334 | children = ( 335 | 2B391BC01778CEC800FF53E7 /* en */, 336 | ); 337 | name = Localizable.strings; 338 | sourceTree = ""; 339 | }; 340 | /* End PBXVariantGroup section */ 341 | 342 | /* Begin XCBuildConfiguration section */ 343 | 2B7326D31778B13900BE08F9 /* Debug */ = { 344 | isa = XCBuildConfiguration; 345 | buildSettings = { 346 | ALWAYS_SEARCH_USER_PATHS = NO; 347 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 348 | CLANG_CXX_LIBRARY = "libc++"; 349 | CLANG_ENABLE_MODULES = YES; 350 | CLANG_ENABLE_OBJC_ARC = YES; 351 | CLANG_WARN_CONSTANT_CONVERSION = YES; 352 | CLANG_WARN_EMPTY_BODY = YES; 353 | CLANG_WARN_ENUM_CONVERSION = YES; 354 | CLANG_WARN_INT_CONVERSION = YES; 355 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 356 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 357 | COPY_PHASE_STRIP = NO; 358 | GCC_C_LANGUAGE_STANDARD = gnu99; 359 | GCC_DYNAMIC_NO_PIC = NO; 360 | GCC_OPTIMIZATION_LEVEL = 0; 361 | GCC_PREPROCESSOR_DEFINITIONS = ( 362 | "DEBUG=1", 363 | "$(inherited)", 364 | ); 365 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 366 | GCC_WARN_ABOUT_MISSING_NEWLINE = YES; 367 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 368 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 369 | GCC_WARN_UNUSED_LABEL = YES; 370 | GCC_WARN_UNUSED_VARIABLE = YES; 371 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 372 | ONLY_ACTIVE_ARCH = YES; 373 | SDKROOT = iphoneos; 374 | TARGETED_DEVICE_FAMILY = "1,2"; 375 | }; 376 | name = Debug; 377 | }; 378 | 2B7326D41778B13900BE08F9 /* Release */ = { 379 | isa = XCBuildConfiguration; 380 | buildSettings = { 381 | ALWAYS_SEARCH_USER_PATHS = NO; 382 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 383 | CLANG_CXX_LIBRARY = "libc++"; 384 | CLANG_ENABLE_MODULES = YES; 385 | CLANG_ENABLE_OBJC_ARC = YES; 386 | CLANG_WARN_CONSTANT_CONVERSION = YES; 387 | CLANG_WARN_EMPTY_BODY = YES; 388 | CLANG_WARN_ENUM_CONVERSION = YES; 389 | CLANG_WARN_INT_CONVERSION = YES; 390 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 391 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 392 | COPY_PHASE_STRIP = YES; 393 | GCC_C_LANGUAGE_STANDARD = gnu99; 394 | GCC_WARN_ABOUT_MISSING_NEWLINE = YES; 395 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 396 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 397 | GCC_WARN_UNUSED_LABEL = YES; 398 | GCC_WARN_UNUSED_VARIABLE = YES; 399 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 400 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 401 | SDKROOT = iphoneos; 402 | TARGETED_DEVICE_FAMILY = "1,2"; 403 | VALIDATE_PRODUCT = YES; 404 | }; 405 | name = Release; 406 | }; 407 | 2B7326D61778B13900BE08F9 /* Debug */ = { 408 | isa = XCBuildConfiguration; 409 | buildSettings = { 410 | CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES; 411 | CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES; 412 | CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES; 413 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 414 | CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; 415 | CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; 416 | GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; 417 | GCC_WARN_SHADOW = YES; 418 | GCC_WARN_SIGN_COMPARE = YES; 419 | GCC_WARN_UNDECLARED_SELECTOR = YES; 420 | GCC_WARN_UNUSED_FUNCTION = YES; 421 | INFOPLIST_FILE = Resources/Info.plist; 422 | LIBRARY_SEARCH_PATHS = ( 423 | "$(inherited)", 424 | "$(PROJECT_DIR)/../Rust", 425 | ); 426 | PRODUCT_NAME = "$(TARGET_NAME)"; 427 | WRAPPER_EXTENSION = app; 428 | }; 429 | name = Debug; 430 | }; 431 | 2B7326D71778B13900BE08F9 /* Release */ = { 432 | isa = XCBuildConfiguration; 433 | buildSettings = { 434 | CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES; 435 | CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES; 436 | CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES; 437 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 438 | CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; 439 | CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; 440 | GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; 441 | GCC_WARN_SHADOW = YES; 442 | GCC_WARN_SIGN_COMPARE = YES; 443 | GCC_WARN_UNDECLARED_SELECTOR = YES; 444 | GCC_WARN_UNUSED_FUNCTION = YES; 445 | INFOPLIST_FILE = Resources/Info.plist; 446 | LIBRARY_SEARCH_PATHS = ( 447 | "$(inherited)", 448 | "$(PROJECT_DIR)/../Rust", 449 | ); 450 | PRODUCT_NAME = "$(TARGET_NAME)"; 451 | WRAPPER_EXTENSION = app; 452 | }; 453 | name = Release; 454 | }; 455 | 2B7326D91778B13900BE08F9 /* Debug */ = { 456 | isa = XCBuildConfiguration; 457 | buildSettings = { 458 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/ObjCrust.app/ObjCrust"; 459 | FRAMEWORK_SEARCH_PATHS = ( 460 | "\"$(SDKROOT)/Developer/Library/Frameworks\"", 461 | "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", 462 | ); 463 | INFOPLIST_FILE = Tests/TestsInfo.plist; 464 | PRODUCT_NAME = "$(TARGET_NAME)"; 465 | TEST_HOST = "$(BUNDLE_LOADER)"; 466 | WRAPPER_EXTENSION = octest; 467 | }; 468 | name = Debug; 469 | }; 470 | 2B7326DA1778B13900BE08F9 /* Release */ = { 471 | isa = XCBuildConfiguration; 472 | buildSettings = { 473 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/ObjCrust.app/ObjCrust"; 474 | FRAMEWORK_SEARCH_PATHS = ( 475 | "\"$(SDKROOT)/Developer/Library/Frameworks\"", 476 | "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"", 477 | ); 478 | INFOPLIST_FILE = Tests/TestsInfo.plist; 479 | PRODUCT_NAME = "$(TARGET_NAME)"; 480 | TEST_HOST = "$(BUNDLE_LOADER)"; 481 | WRAPPER_EXTENSION = octest; 482 | }; 483 | name = Release; 484 | }; 485 | /* End XCBuildConfiguration section */ 486 | 487 | /* Begin XCConfigurationList section */ 488 | 2B73269E1778B13800BE08F9 /* Build configuration list for PBXProject "ObjCrust" */ = { 489 | isa = XCConfigurationList; 490 | buildConfigurations = ( 491 | 2B7326D31778B13900BE08F9 /* Debug */, 492 | 2B7326D41778B13900BE08F9 /* Release */, 493 | ); 494 | defaultConfigurationIsVisible = 0; 495 | defaultConfigurationName = Release; 496 | }; 497 | 2B7326D51778B13900BE08F9 /* Build configuration list for PBXNativeTarget "ObjCrust" */ = { 498 | isa = XCConfigurationList; 499 | buildConfigurations = ( 500 | 2B7326D61778B13900BE08F9 /* Debug */, 501 | 2B7326D71778B13900BE08F9 /* Release */, 502 | ); 503 | defaultConfigurationIsVisible = 0; 504 | defaultConfigurationName = Release; 505 | }; 506 | 2B7326D81778B13900BE08F9 /* Build configuration list for PBXNativeTarget "Unit Tests" */ = { 507 | isa = XCConfigurationList; 508 | buildConfigurations = ( 509 | 2B7326D91778B13900BE08F9 /* Debug */, 510 | 2B7326DA1778B13900BE08F9 /* Release */, 511 | ); 512 | defaultConfigurationIsVisible = 0; 513 | defaultConfigurationName = Release; 514 | }; 515 | /* End XCConfigurationList section */ 516 | }; 517 | rootObject = 2B73269B1778B13800BE08F9 /* Project object */; 518 | } 519 | -------------------------------------------------------------------------------- /iOS/Resources/Images/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shilgapira/ObjCrust/707db35e0a214fd22ce8f969fa1d13fdd26d36c0/iOS/Resources/Images/Default-568h@2x.png -------------------------------------------------------------------------------- /iOS/Resources/Images/Default-Landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shilgapira/ObjCrust/707db35e0a214fd22ce8f969fa1d13fdd26d36c0/iOS/Resources/Images/Default-Landscape.png -------------------------------------------------------------------------------- /iOS/Resources/Images/Default-Landscape@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shilgapira/ObjCrust/707db35e0a214fd22ce8f969fa1d13fdd26d36c0/iOS/Resources/Images/Default-Landscape@2x.png -------------------------------------------------------------------------------- /iOS/Resources/Images/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shilgapira/ObjCrust/707db35e0a214fd22ce8f969fa1d13fdd26d36c0/iOS/Resources/Images/Default-Portrait.png -------------------------------------------------------------------------------- /iOS/Resources/Images/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shilgapira/ObjCrust/707db35e0a214fd22ce8f969fa1d13fdd26d36c0/iOS/Resources/Images/Default-Portrait@2x.png -------------------------------------------------------------------------------- /iOS/Resources/Images/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shilgapira/ObjCrust/707db35e0a214fd22ce8f969fa1d13fdd26d36c0/iOS/Resources/Images/Default.png -------------------------------------------------------------------------------- /iOS/Resources/Images/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shilgapira/ObjCrust/707db35e0a214fd22ce8f969fa1d13fdd26d36c0/iOS/Resources/Images/Default@2x.png -------------------------------------------------------------------------------- /iOS/Resources/Images/Icon-ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shilgapira/ObjCrust/707db35e0a214fd22ce8f969fa1d13fdd26d36c0/iOS/Resources/Images/Icon-ipad.png -------------------------------------------------------------------------------- /iOS/Resources/Images/Icon-ipad@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shilgapira/ObjCrust/707db35e0a214fd22ce8f969fa1d13fdd26d36c0/iOS/Resources/Images/Icon-ipad@2x.png -------------------------------------------------------------------------------- /iOS/Resources/Images/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shilgapira/ObjCrust/707db35e0a214fd22ce8f969fa1d13fdd26d36c0/iOS/Resources/Images/Icon.png -------------------------------------------------------------------------------- /iOS/Resources/Images/Icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shilgapira/ObjCrust/707db35e0a214fd22ce8f969fa1d13fdd26d36c0/iOS/Resources/Images/Icon@2x.png -------------------------------------------------------------------------------- /iOS/Resources/Images/iTunesArtwork: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shilgapira/ObjCrust/707db35e0a214fd22ce8f969fa1d13fdd26d36c0/iOS/Resources/Images/iTunesArtwork -------------------------------------------------------------------------------- /iOS/Resources/Images/iTunesArtwork@2x: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shilgapira/ObjCrust/707db35e0a214fd22ce8f969fa1d13fdd26d36c0/iOS/Resources/Images/iTunesArtwork@2x -------------------------------------------------------------------------------- /iOS/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFiles 12 | 13 | Icon.png 14 | Icon@2x.png 15 | Icon-ipad.png 16 | Icon-ipad@2x.png 17 | 18 | CFBundleIdentifier 19 | com.gilshapira.objcrust 20 | CFBundleInfoDictionaryVersion 21 | 6.0 22 | CFBundleName 23 | ${PRODUCT_NAME} 24 | CFBundlePackageType 25 | APPL 26 | CFBundleShortVersionString 27 | 1.0 28 | CFBundleSignature 29 | ???? 30 | CFBundleVersion 31 | 100 32 | LSRequiresIPhoneOS 33 | 34 | UILaunchImages 35 | 36 | 37 | UILaunchImageMinimumOSVersion 38 | 7.0 39 | UILaunchImageName 40 | Default 41 | UILaunchImageOrientation 42 | Portrait 43 | UILaunchImageSize 44 | {320, 568} 45 | 46 | 47 | UILaunchImageMinimumOSVersion 48 | 7.0 49 | UILaunchImageName 50 | Default 51 | UILaunchImageOrientation 52 | Portrait 53 | UILaunchImageSize 54 | {320, 480} 55 | 56 | 57 | UILaunchImages~ipad 58 | 59 | 60 | UILaunchImageMinimumOSVersion 61 | 7.0 62 | UILaunchImageName 63 | Default-Landscape 64 | UILaunchImageOrientation 65 | Landscape 66 | UILaunchImageSize 67 | {768, 1024} 68 | 69 | 70 | UILaunchImageMinimumOSVersion 71 | 7.0 72 | UILaunchImageName 73 | Default-Portrait 74 | UILaunchImageOrientation 75 | Portrait 76 | UILaunchImageSize 77 | {768, 1024} 78 | 79 | 80 | UIRequiredDeviceCapabilities 81 | 82 | armv7 83 | 84 | UIStatusBarHidden 85 | 86 | UIStatusBarStyle 87 | UIStatusBarStyleDefault 88 | UISupportedInterfaceOrientations 89 | 90 | UIInterfaceOrientationPortrait 91 | UIInterfaceOrientationLandscapeLeft 92 | UIInterfaceOrientationLandscapeRight 93 | 94 | UISupportedInterfaceOrientations~ipad 95 | 96 | UIInterfaceOrientationPortrait 97 | UIInterfaceOrientationPortraitUpsideDown 98 | UIInterfaceOrientationLandscapeLeft 99 | UIInterfaceOrientationLandscapeRight 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /iOS/Resources/Localized/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | 2 | /* Localized versions of Info.plist keys */ 3 | -------------------------------------------------------------------------------- /iOS/Resources/Localized/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shilgapira/ObjCrust/707db35e0a214fd22ce8f969fa1d13fdd26d36c0/iOS/Resources/Localized/en.lproj/Localizable.strings -------------------------------------------------------------------------------- /iOS/Sources/CRAppDelegate.h: -------------------------------------------------------------------------------- 1 | 2 | #import 3 | 4 | 5 | @interface CRAppDelegate : UIResponder 6 | 7 | @property (nonatomic,strong) UIWindow *window; 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /iOS/Sources/CRAppDelegate.m: -------------------------------------------------------------------------------- 1 | 2 | #import "CRAppDelegate.h" 3 | #import "CRViewController.h" 4 | 5 | 6 | @implementation CRAppDelegate 7 | 8 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)options { 9 | UIViewController *vc = [CRViewController new]; 10 | UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc]; 11 | vc.navigationItem.title = @"ObjCrust"; 12 | 13 | self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds]; 14 | self.window.rootViewController = nav; 15 | [self.window makeKeyAndVisible]; 16 | 17 | return YES; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /iOS/Sources/CRViewController.h: -------------------------------------------------------------------------------- 1 | 2 | #import 3 | 4 | 5 | @interface CRViewController : UITableViewController 6 | 7 | @end 8 | -------------------------------------------------------------------------------- /iOS/Sources/CRViewController.m: -------------------------------------------------------------------------------- 1 | 2 | #import "CRViewController.h" 3 | #import "objcrust.h" 4 | 5 | 6 | @implementation CRViewController 7 | 8 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 9 | return 12; 10 | } 11 | 12 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 13 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"]; 14 | if (!cell) { 15 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"Cell"]; 16 | } 17 | 18 | NSString *title = nil; 19 | NSString *value = nil; 20 | 21 | switch (indexPath.row) { 22 | case 0: { 23 | title = @"get_num()"; 24 | value = [NSString stringWithFormat:@"%d",get_num()]; 25 | break; 26 | } 27 | 28 | case 1: { 29 | title = @"get_float()"; 30 | value = [NSString stringWithFormat:@"%f",get_float()]; 31 | break; 32 | } 33 | 34 | case 2: { 35 | title = @"inc_num(get_num())"; 36 | value = [NSString stringWithFormat:@"%d",inc_num(get_num())]; 37 | break; 38 | } 39 | 40 | case 3: { 41 | title = @"add_num(42, 24)"; 42 | value = [NSString stringWithFormat:@"%d",add_nums(42, 24)]; 43 | break; 44 | } 45 | 46 | case 4: { 47 | title = @"inc_num_ptr(&num)"; 48 | value = [NSString stringWithFormat:@"%d",({ unsigned num = 10; inc_num_ptr(&num); num; })]; 49 | break; 50 | } 51 | 52 | case 5: { 53 | title = @"inc_float_ptr(&num)"; 54 | value = [NSString stringWithFormat:@"%f",({ double num = 41.42; inc_float_ptr(&num); num; })]; 55 | break; 56 | } 57 | 58 | case 6: { 59 | Pair pair = get_pair(); 60 | title = @"get_pair()"; 61 | value = [NSString stringWithFormat:@"(%u,%u)", pair.foo, pair.bar]; 62 | break; 63 | } 64 | 65 | case 7: { 66 | Pair pair = inc_pair(get_pair()); 67 | title = @"inc_pair(get_pair())"; 68 | value = [NSString stringWithFormat:@"(%u,%u)", pair.foo, pair.bar]; 69 | break; 70 | } 71 | 72 | case 8: { 73 | Pair pair = get_pair(); 74 | inc_pair_ptr(&pair); 75 | title = @"inc_pair_ptr(&pair)"; 76 | value = [NSString stringWithFormat:@"(%u,%u)", pair.foo, pair.bar]; 77 | break; 78 | } 79 | 80 | case 9: { 81 | Complex comp = get_complex(); 82 | title = @"get_complex()"; 83 | value = [NSString stringWithFormat:@"(%f,%f)", comp.real, comp.img]; 84 | break; 85 | } 86 | 87 | case 10: { 88 | Complex comp = inc_complex(get_complex()); 89 | title = @"inc_complex(get_complex())"; 90 | value = [NSString stringWithFormat:@"(%f,%f)", comp.real, comp.img]; 91 | break; 92 | } 93 | 94 | case 11: { 95 | Complex comp = get_complex(); 96 | inc_complex_ptr(&comp); 97 | title = @"inc_complex_ptr(&comp)"; 98 | value = [NSString stringWithFormat:@"(%f,%f)", comp.real, comp.img]; 99 | break; 100 | } 101 | } 102 | 103 | cell.textLabel.text = title; 104 | cell.detailTextLabel.text = value; 105 | 106 | return cell; 107 | } 108 | 109 | @end 110 | -------------------------------------------------------------------------------- /iOS/Sources/main.m: -------------------------------------------------------------------------------- 1 | 2 | #import "CRAppDelegate.h" 3 | 4 | 5 | int main(int argc, char *argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass(CRAppDelegate.class)); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /iOS/Tests/TestRust.m: -------------------------------------------------------------------------------- 1 | 2 | #import 3 | 4 | 5 | @interface TestRust : SenTestCase 6 | 7 | @end 8 | 9 | 10 | @implementation TestRust 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /iOS/Tests/TestsInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.gilshapira.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | --------------------------------------------------------------------------------