├── README.md ├── .gitignore ├── LICENSE ├── SO-32541268 ├── SO-32541268-Bridging-Header.h ├── CPP.hpp ├── CPP-Wrapper.h ├── Objective-C.h ├── C.c ├── Objective-CPP.h ├── Swift.swift ├── C.h ├── AppDelegate.swift ├── Objective-C.m ├── CPP.cpp ├── CPP-Wrapper.mm ├── Info.plist ├── Objective-CPP.mm ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── Main.storyboard │ └── LaunchScreen.storyboard └── ViewController.swift └── SO-32541268.xcodeproj └── project.pbxproj /README.md: -------------------------------------------------------------------------------- 1 | # Mix Swift, Objective-C, C and C++ files in the same Xcode project 2 | 3 | --- 4 | 5 | ### Stack Overflow Question 32541268 6 | 7 | Xcode project & source code related to [C, C++, Objective-C wrapper for C++, Objective-C, Objective-C++, Swift & Bridging-Header.h](https://stackoverflow.com/questions/32541268/can-i-have-swift-objective-c-c-and-c-files-in-the-same-xcode-project/32546879#32546879) answer. 8 | 9 | --- 10 | 11 | **Instructions:** 12 | 13 | 1. build & run 14 | 2. observe log 15 | 16 | **References:** 17 | 18 | - Question [32541268](https://stackoverflow.com/questions/32541268) on Stack Overflow 19 | - This and other answers posted on [Swift Recipes](http://swiftarchitect.com/recipes/) 20 | 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Mac OS X Finder 2 | .DS_Store 3 | 4 | # Sparkle distribution Private Key (Don’t check me in!) 5 | dsa_priv.pem 6 | 7 | # XCode (and ancestors) per-user config (very noisy, and not relevant) 8 | *.mode1 9 | *.mode1v3 10 | *.mode2v3 11 | *.perspective 12 | *.perspectivev3 13 | *.pbxuser 14 | 15 | # Xcode 4 16 | xcuserdata/ 17 | *.xcworkspace/ 18 | DerivedData/ 19 | 20 | # Generated files 21 | VersionX-revision.h 22 | 23 | # build products 24 | build/ 25 | *.[oa] 26 | 27 | # Other source repository archive directories (protects when importing) 28 | .hg 29 | .svn 30 | CVS 31 | 32 | # automatic backup files 33 | *~.nib 34 | *.swp 35 | *~ 36 | *(Autosaved).rtfd/ 37 | Backup[ ]of[ ]*.pages/ 38 | Backup[ ]of[ ]*.key/ 39 | Backup[ ]of[ ]*.numbers/ 40 | 41 | # Cocoapods 42 | Podfile.lock 43 | Pods/ 44 | 45 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright © 2017, 2018 Xavier Schott 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /SO-32541268/SO-32541268-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // SO-32541268-Bridging-Header.h 3 | // SO-32541268 4 | // 5 | // Copyright © 2017, 2018 Xavier Schott 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | // 25 | 26 | #import "C.h" 27 | #import "CPP-Wrapper.h" 28 | #import "Objective-C.h" 29 | #import "Objective-CPP.h" 30 | -------------------------------------------------------------------------------- /SO-32541268/CPP.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // CPP.hpp 3 | // SO-32541268 4 | // 5 | // Copyright © 2017, 2018 Xavier Schott 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | // 25 | 26 | // Declaration: CPP.hpp 27 | #pragma once 28 | #include 29 | 30 | class CPP { 31 | public: 32 | void helloWorld_cpp(); 33 | void hello_cpp(const std::string& name); 34 | }; 35 | -------------------------------------------------------------------------------- /SO-32541268/CPP-Wrapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPP-Wrapper.h 3 | // SO-32541268 4 | // 5 | // Copyright © 2017, 2018 Xavier Schott 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | // 25 | 26 | // Declaration: CPP-Wrapper.h 27 | #import 28 | 29 | @interface CPP_Wrapper : NSObject 30 | - (void)helloWorld_cpp_wrapped; 31 | - (void)hello_cpp_wrapped:(NSString *)name; 32 | @end 33 | -------------------------------------------------------------------------------- /SO-32541268/Objective-C.h: -------------------------------------------------------------------------------- 1 | // 2 | // Objective-C.h 3 | // SO-32541268 4 | // 5 | // Copyright © 2017, 2018 Xavier Schott 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | // 25 | 26 | // Declaration: Objective-C.h 27 | #import 28 | 29 | @interface Objective_C : NSObject 30 | - (void)helloWorld_objectiveC; 31 | - (void)hello_objectiveC:(NSString *)name; 32 | @end 33 | -------------------------------------------------------------------------------- /SO-32541268/C.c: -------------------------------------------------------------------------------- 1 | // 2 | // C.c 3 | // SO-32541268 4 | // 5 | // Copyright © 2017, 2018 Xavier Schott 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | // 25 | 26 | // Definition: C.c 27 | #include "C.h" 28 | #include 29 | 30 | void helloWorld_c() { 31 | printf("Hello World in C\n"); 32 | } 33 | 34 | void hello_c(const char * name) { 35 | printf("Hello %s in C\n", name); 36 | } 37 | -------------------------------------------------------------------------------- /SO-32541268/Objective-CPP.h: -------------------------------------------------------------------------------- 1 | // 2 | // Objective-CPP.h 3 | // SO-32541268 4 | // 5 | // Copyright © 2017, 2018 Xavier Schott 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | // 25 | 26 | // Declaration: Objective-CPP.h 27 | #import 28 | 29 | @interface Objective_CPP : NSObject 30 | - (void)helloWorld_objectiveCpp; 31 | - (void)hello_objectiveCpp:(NSString *)name; 32 | @end 33 | -------------------------------------------------------------------------------- /SO-32541268/Swift.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Swift.swift 3 | // SO-32541268 4 | // 5 | // Copyright © 2017, 2018 Xavier Schott 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | // 25 | 26 | // Declaration & definition: Swift.swift 27 | class Swift { 28 | func helloWorld_swift() { 29 | print("Hello World in Swift") 30 | } 31 | 32 | func hello_swift(_ name: String) { 33 | print("Hello \(name) in Swift") 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /SO-32541268/C.h: -------------------------------------------------------------------------------- 1 | // 2 | // C.h 3 | // SO-32541268 4 | // 5 | // Copyright © 2017, 2018 Xavier Schott 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | // 25 | 26 | // Declaration: C.h 27 | #ifndef C_h 28 | #define C_h 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | void helloWorld_c(void); 35 | void hello_c(const char * name); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | 42 | #endif /* C_h */ 43 | -------------------------------------------------------------------------------- /SO-32541268/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SO-32541268 4 | // 5 | // Copyright © 2017, 2018 Xavier Schott 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | // 25 | 26 | import UIKit 27 | 28 | @UIApplicationMain 29 | class AppDelegate: UIResponder, UIApplicationDelegate { 30 | 31 | var window: UIWindow? 32 | 33 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 34 | return true 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /SO-32541268/Objective-C.m: -------------------------------------------------------------------------------- 1 | // 2 | // Objective-C.m 3 | // SO-32541268 4 | // 5 | // Copyright © 2017, 2018 Xavier Schott 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | // 25 | 26 | // Definition: Objective-C.m 27 | #import "Objective-C.h" 28 | 29 | @implementation Objective_C 30 | - (void)helloWorld_objectiveC { 31 | printf("Hello World in Objective-C\n"); 32 | } 33 | 34 | - (void)hello_objectiveC:(NSString*)name { 35 | printf("Hello %s in Objective-C\n", [name cStringUsingEncoding:NSUTF8StringEncoding]); 36 | } 37 | @end 38 | -------------------------------------------------------------------------------- /SO-32541268/CPP.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // CPP.cpp 3 | // SO-32541268 4 | // 5 | // Copyright © 2017, 2018 Xavier Schott 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | // 25 | 26 | // Definition: CPP.cpp 27 | #include "CPP.hpp" 28 | #include "C.h" 29 | #include 30 | 31 | using namespace std; 32 | 33 | void CPP::helloWorld_cpp() { 34 | cout << "Hello World in C++" << endl; 35 | } 36 | 37 | void CPP::hello_cpp(const std::string& name) { 38 | hello_c(name.c_str()); 39 | cout << "Hello " << name << " in C++" << endl; 40 | } 41 | -------------------------------------------------------------------------------- /SO-32541268/CPP-Wrapper.mm: -------------------------------------------------------------------------------- 1 | // 2 | // CPP-Wrapper.mm 3 | // SO-32541268 4 | // 5 | // Copyright © 2017, 2018 Xavier Schott 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | // 25 | 26 | // Definition: CPP-Wrapper.mm 27 | #import "CPP-Wrapper.h" 28 | #include "CPP.hpp" 29 | 30 | @implementation CPP_Wrapper 31 | 32 | - (void)helloWorld_cpp_wrapped { 33 | CPP cpp; 34 | cpp.helloWorld_cpp(); 35 | } 36 | 37 | - (void)hello_cpp_wrapped:(NSString *)name { 38 | CPP cpp; 39 | cpp.hello_cpp([name cStringUsingEncoding:NSUTF8StringEncoding]); 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /SO-32541268/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 11 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 | -------------------------------------------------------------------------------- /SO-32541268/Objective-CPP.mm: -------------------------------------------------------------------------------- 1 | // 2 | // Objective-CPP.mm 3 | // SO-32541268 4 | // 5 | // Copyright © 2017, 2018 Xavier Schott 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | // 25 | 26 | // Definition: Objective-CPP.mm 27 | #include 28 | #import "Objective-CPP.h" 29 | 30 | using namespace std; 31 | 32 | @implementation Objective_CPP 33 | - (void)helloWorld_objectiveCpp { 34 | cout << "Hello World in Objective-C++\n"; 35 | } 36 | 37 | - (void)hello_objectiveCpp:(NSString *)name { 38 | cout << "Hello " << [name cStringUsingEncoding:NSUTF8StringEncoding] << " in Objective-C++\n"; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /SO-32541268/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /SO-32541268/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 | -------------------------------------------------------------------------------- /SO-32541268/Base.lproj/LaunchScreen.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 | -------------------------------------------------------------------------------- /SO-32541268/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // SO-32541268 4 | // 5 | // Copyright © 2017, 2018 Xavier Schott 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | // 25 | 26 | import UIKit 27 | 28 | class ViewController: UIViewController { 29 | 30 | override func viewDidLoad() { 31 | super.viewDidLoad() 32 | 33 | let world = "World" 34 | 35 | // Invoke C 36 | helloWorld_c(); 37 | hello_c(world.cString(using: String.Encoding.utf8)!) 38 | 39 | // Can't Invoke C++ without a wrapper 40 | // CPP().helloWorld_cpp() 41 | // CPP().hello_cpp(world.cStringUsingEncoding(NSUTF8StringEncoding)!) 42 | // Invoke C++ through Objective-C 43 | CPP_Wrapper().helloWorld_cpp_wrapped() 44 | CPP_Wrapper().hello_cpp_wrapped(world) 45 | 46 | // Invoke Objective-C 47 | Objective_C().helloWorld_objectiveC() 48 | Objective_C().hello_objectiveC(world) 49 | 50 | // Invoke Objective-C++ 51 | Objective_CPP().helloWorld_objectiveCpp() 52 | Objective_CPP().hello_objectiveCpp(world) 53 | 54 | // Invoke Swift 55 | Swift().helloWorld_swift() 56 | Swift().hello_swift(world) 57 | } 58 | } 59 | 60 | -------------------------------------------------------------------------------- /SO-32541268.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | DC2764E01BA54CC200B120DC /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC2764DF1BA54CC200B120DC /* AppDelegate.swift */; }; 11 | DC2764E21BA54CC200B120DC /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC2764E11BA54CC200B120DC /* ViewController.swift */; }; 12 | DC2764E51BA54CC200B120DC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DC2764E31BA54CC200B120DC /* Main.storyboard */; }; 13 | DC2764E71BA54CC200B120DC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DC2764E61BA54CC200B120DC /* Assets.xcassets */; }; 14 | DC2764EA1BA54CC200B120DC /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DC2764E81BA54CC200B120DC /* LaunchScreen.storyboard */; }; 15 | DC2764F41BA54CF400B120DC /* Objective-C.m in Sources */ = {isa = PBXBuildFile; fileRef = DC2764F31BA54CF400B120DC /* Objective-C.m */; }; 16 | DC2764F71BA552A900B120DC /* C.c in Sources */ = {isa = PBXBuildFile; fileRef = DC2764F61BA552A900B120DC /* C.c */; }; 17 | DC2764FA1BA554F100B120DC /* CPP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DC2764F81BA554F100B120DC /* CPP.cpp */; }; 18 | DC2764FD1BA55F4400B120DC /* CPP-Wrapper.mm in Sources */ = {isa = PBXBuildFile; fileRef = DC2764FC1BA55F4400B120DC /* CPP-Wrapper.mm */; }; 19 | DC2765001BA5668400B120DC /* Objective-CPP.mm in Sources */ = {isa = PBXBuildFile; fileRef = DC2764FF1BA5668400B120DC /* Objective-CPP.mm */; }; 20 | DC2765021BA567B000B120DC /* Swift.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC2765011BA567B000B120DC /* Swift.swift */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXFileReference section */ 24 | DC2764DC1BA54CC200B120DC /* SO-32541268.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SO-32541268.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 25 | DC2764DF1BA54CC200B120DC /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 26 | DC2764E11BA54CC200B120DC /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 27 | DC2764E41BA54CC200B120DC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 28 | DC2764E61BA54CC200B120DC /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 29 | DC2764E91BA54CC200B120DC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 30 | DC2764EB1BA54CC200B120DC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | DC2764F11BA54CF400B120DC /* SO-32541268-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SO-32541268-Bridging-Header.h"; sourceTree = ""; }; 32 | DC2764F21BA54CF400B120DC /* Objective-C.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Objective-C.h"; sourceTree = ""; }; 33 | DC2764F31BA54CF400B120DC /* Objective-C.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Objective-C.m"; sourceTree = ""; }; 34 | DC2764F51BA552A900B120DC /* C.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = C.h; sourceTree = ""; }; 35 | DC2764F61BA552A900B120DC /* C.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = C.c; sourceTree = ""; }; 36 | DC2764F81BA554F100B120DC /* CPP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CPP.cpp; sourceTree = ""; }; 37 | DC2764F91BA554F100B120DC /* CPP.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = CPP.hpp; sourceTree = ""; }; 38 | DC2764FB1BA55F4400B120DC /* CPP-Wrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CPP-Wrapper.h"; sourceTree = ""; }; 39 | DC2764FC1BA55F4400B120DC /* CPP-Wrapper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "CPP-Wrapper.mm"; sourceTree = ""; }; 40 | DC2764FE1BA5668400B120DC /* Objective-CPP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Objective-CPP.h"; sourceTree = ""; }; 41 | DC2764FF1BA5668400B120DC /* Objective-CPP.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "Objective-CPP.mm"; sourceTree = ""; }; 42 | DC2765011BA567B000B120DC /* Swift.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Swift.swift; sourceTree = ""; }; 43 | /* End PBXFileReference section */ 44 | 45 | /* Begin PBXFrameworksBuildPhase section */ 46 | DC2764D91BA54CC200B120DC /* Frameworks */ = { 47 | isa = PBXFrameworksBuildPhase; 48 | buildActionMask = 2147483647; 49 | files = ( 50 | ); 51 | runOnlyForDeploymentPostprocessing = 0; 52 | }; 53 | /* End PBXFrameworksBuildPhase section */ 54 | 55 | /* Begin PBXGroup section */ 56 | DC2764D31BA54CC200B120DC = { 57 | isa = PBXGroup; 58 | children = ( 59 | DC2764DE1BA54CC200B120DC /* SO-32541268 */, 60 | DC2764DD1BA54CC200B120DC /* Products */, 61 | ); 62 | sourceTree = ""; 63 | }; 64 | DC2764DD1BA54CC200B120DC /* Products */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | DC2764DC1BA54CC200B120DC /* SO-32541268.app */, 68 | ); 69 | name = Products; 70 | sourceTree = ""; 71 | }; 72 | DC2764DE1BA54CC200B120DC /* SO-32541268 */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | DC2764DF1BA54CC200B120DC /* AppDelegate.swift */, 76 | DC2764E11BA54CC200B120DC /* ViewController.swift */, 77 | DC2764F51BA552A900B120DC /* C.h */, 78 | DC2764F61BA552A900B120DC /* C.c */, 79 | DC2764F91BA554F100B120DC /* CPP.hpp */, 80 | DC2764F81BA554F100B120DC /* CPP.cpp */, 81 | DC2764FB1BA55F4400B120DC /* CPP-Wrapper.h */, 82 | DC2764FC1BA55F4400B120DC /* CPP-Wrapper.mm */, 83 | DC2764F21BA54CF400B120DC /* Objective-C.h */, 84 | DC2764F31BA54CF400B120DC /* Objective-C.m */, 85 | DC2764FE1BA5668400B120DC /* Objective-CPP.h */, 86 | DC2764FF1BA5668400B120DC /* Objective-CPP.mm */, 87 | DC2765011BA567B000B120DC /* Swift.swift */, 88 | DC2764E31BA54CC200B120DC /* Main.storyboard */, 89 | DC2764E61BA54CC200B120DC /* Assets.xcassets */, 90 | DC2764E81BA54CC200B120DC /* LaunchScreen.storyboard */, 91 | DC2764EB1BA54CC200B120DC /* Info.plist */, 92 | DC2764F11BA54CF400B120DC /* SO-32541268-Bridging-Header.h */, 93 | ); 94 | path = "SO-32541268"; 95 | sourceTree = ""; 96 | }; 97 | /* End PBXGroup section */ 98 | 99 | /* Begin PBXNativeTarget section */ 100 | DC2764DB1BA54CC200B120DC /* SO-32541268 */ = { 101 | isa = PBXNativeTarget; 102 | buildConfigurationList = DC2764EE1BA54CC200B120DC /* Build configuration list for PBXNativeTarget "SO-32541268" */; 103 | buildPhases = ( 104 | DC2764D81BA54CC200B120DC /* Sources */, 105 | DC2764D91BA54CC200B120DC /* Frameworks */, 106 | DC2764DA1BA54CC200B120DC /* Resources */, 107 | ); 108 | buildRules = ( 109 | ); 110 | dependencies = ( 111 | ); 112 | name = "SO-32541268"; 113 | productName = "SO-32541268"; 114 | productReference = DC2764DC1BA54CC200B120DC /* SO-32541268.app */; 115 | productType = "com.apple.product-type.application"; 116 | }; 117 | /* End PBXNativeTarget section */ 118 | 119 | /* Begin PBXProject section */ 120 | DC2764D41BA54CC200B120DC /* Project object */ = { 121 | isa = PBXProject; 122 | attributes = { 123 | LastSwiftUpdateCheck = 0700; 124 | LastUpgradeCheck = 0940; 125 | ORGANIZATIONNAME = SwiftArchitect; 126 | TargetAttributes = { 127 | DC2764DB1BA54CC200B120DC = { 128 | CreatedOnToolsVersion = 7.0; 129 | LastSwiftMigration = 0940; 130 | }; 131 | }; 132 | }; 133 | buildConfigurationList = DC2764D71BA54CC200B120DC /* Build configuration list for PBXProject "SO-32541268" */; 134 | compatibilityVersion = "Xcode 9.3"; 135 | developmentRegion = English; 136 | hasScannedForEncodings = 0; 137 | knownRegions = ( 138 | en, 139 | Base, 140 | ); 141 | mainGroup = DC2764D31BA54CC200B120DC; 142 | productRefGroup = DC2764DD1BA54CC200B120DC /* Products */; 143 | projectDirPath = ""; 144 | projectRoot = ""; 145 | targets = ( 146 | DC2764DB1BA54CC200B120DC /* SO-32541268 */, 147 | ); 148 | }; 149 | /* End PBXProject section */ 150 | 151 | /* Begin PBXResourcesBuildPhase section */ 152 | DC2764DA1BA54CC200B120DC /* Resources */ = { 153 | isa = PBXResourcesBuildPhase; 154 | buildActionMask = 2147483647; 155 | files = ( 156 | DC2764EA1BA54CC200B120DC /* LaunchScreen.storyboard in Resources */, 157 | DC2764E71BA54CC200B120DC /* Assets.xcassets in Resources */, 158 | DC2764E51BA54CC200B120DC /* Main.storyboard in Resources */, 159 | ); 160 | runOnlyForDeploymentPostprocessing = 0; 161 | }; 162 | /* End PBXResourcesBuildPhase section */ 163 | 164 | /* Begin PBXSourcesBuildPhase section */ 165 | DC2764D81BA54CC200B120DC /* Sources */ = { 166 | isa = PBXSourcesBuildPhase; 167 | buildActionMask = 2147483647; 168 | files = ( 169 | DC2765001BA5668400B120DC /* Objective-CPP.mm in Sources */, 170 | DC2764E21BA54CC200B120DC /* ViewController.swift in Sources */, 171 | DC2764F71BA552A900B120DC /* C.c in Sources */, 172 | DC2765021BA567B000B120DC /* Swift.swift in Sources */, 173 | DC2764FA1BA554F100B120DC /* CPP.cpp in Sources */, 174 | DC2764FD1BA55F4400B120DC /* CPP-Wrapper.mm in Sources */, 175 | DC2764F41BA54CF400B120DC /* Objective-C.m in Sources */, 176 | DC2764E01BA54CC200B120DC /* AppDelegate.swift in Sources */, 177 | ); 178 | runOnlyForDeploymentPostprocessing = 0; 179 | }; 180 | /* End PBXSourcesBuildPhase section */ 181 | 182 | /* Begin PBXVariantGroup section */ 183 | DC2764E31BA54CC200B120DC /* Main.storyboard */ = { 184 | isa = PBXVariantGroup; 185 | children = ( 186 | DC2764E41BA54CC200B120DC /* Base */, 187 | ); 188 | name = Main.storyboard; 189 | sourceTree = ""; 190 | }; 191 | DC2764E81BA54CC200B120DC /* LaunchScreen.storyboard */ = { 192 | isa = PBXVariantGroup; 193 | children = ( 194 | DC2764E91BA54CC200B120DC /* Base */, 195 | ); 196 | name = LaunchScreen.storyboard; 197 | sourceTree = ""; 198 | }; 199 | /* End PBXVariantGroup section */ 200 | 201 | /* Begin XCBuildConfiguration section */ 202 | DC2764EC1BA54CC200B120DC /* Debug */ = { 203 | isa = XCBuildConfiguration; 204 | buildSettings = { 205 | ALWAYS_SEARCH_USER_PATHS = NO; 206 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 207 | CLANG_CXX_LIBRARY = "libc++"; 208 | CLANG_ENABLE_MODULES = YES; 209 | CLANG_ENABLE_OBJC_ARC = YES; 210 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 211 | CLANG_WARN_BOOL_CONVERSION = YES; 212 | CLANG_WARN_COMMA = YES; 213 | CLANG_WARN_CONSTANT_CONVERSION = YES; 214 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 215 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 216 | CLANG_WARN_EMPTY_BODY = YES; 217 | CLANG_WARN_ENUM_CONVERSION = YES; 218 | CLANG_WARN_INFINITE_RECURSION = YES; 219 | CLANG_WARN_INT_CONVERSION = YES; 220 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 221 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 222 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 223 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 224 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 225 | CLANG_WARN_STRICT_PROTOTYPES = YES; 226 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 227 | CLANG_WARN_UNREACHABLE_CODE = YES; 228 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 229 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 230 | COPY_PHASE_STRIP = NO; 231 | DEBUG_INFORMATION_FORMAT = dwarf; 232 | ENABLE_STRICT_OBJC_MSGSEND = YES; 233 | ENABLE_TESTABILITY = YES; 234 | GCC_C_LANGUAGE_STANDARD = gnu99; 235 | GCC_DYNAMIC_NO_PIC = NO; 236 | GCC_NO_COMMON_BLOCKS = YES; 237 | GCC_OPTIMIZATION_LEVEL = 0; 238 | GCC_PREPROCESSOR_DEFINITIONS = ( 239 | "DEBUG=1", 240 | "$(inherited)", 241 | ); 242 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 243 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 244 | GCC_WARN_UNDECLARED_SELECTOR = YES; 245 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 246 | GCC_WARN_UNUSED_FUNCTION = YES; 247 | GCC_WARN_UNUSED_VARIABLE = YES; 248 | MTL_ENABLE_DEBUG_INFO = YES; 249 | ONLY_ACTIVE_ARCH = YES; 250 | SDKROOT = iphoneos; 251 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 252 | TARGETED_DEVICE_FAMILY = "1,2"; 253 | }; 254 | name = Debug; 255 | }; 256 | DC2764ED1BA54CC200B120DC /* Release */ = { 257 | isa = XCBuildConfiguration; 258 | buildSettings = { 259 | ALWAYS_SEARCH_USER_PATHS = NO; 260 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 261 | CLANG_CXX_LIBRARY = "libc++"; 262 | CLANG_ENABLE_MODULES = YES; 263 | CLANG_ENABLE_OBJC_ARC = YES; 264 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 265 | CLANG_WARN_BOOL_CONVERSION = YES; 266 | CLANG_WARN_COMMA = YES; 267 | CLANG_WARN_CONSTANT_CONVERSION = YES; 268 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 269 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 270 | CLANG_WARN_EMPTY_BODY = YES; 271 | CLANG_WARN_ENUM_CONVERSION = YES; 272 | CLANG_WARN_INFINITE_RECURSION = YES; 273 | CLANG_WARN_INT_CONVERSION = YES; 274 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 275 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 276 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 277 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 278 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 279 | CLANG_WARN_STRICT_PROTOTYPES = YES; 280 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 281 | CLANG_WARN_UNREACHABLE_CODE = YES; 282 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 283 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 284 | COPY_PHASE_STRIP = NO; 285 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 286 | ENABLE_NS_ASSERTIONS = NO; 287 | ENABLE_STRICT_OBJC_MSGSEND = YES; 288 | GCC_C_LANGUAGE_STANDARD = gnu99; 289 | GCC_NO_COMMON_BLOCKS = YES; 290 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 291 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 292 | GCC_WARN_UNDECLARED_SELECTOR = YES; 293 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 294 | GCC_WARN_UNUSED_FUNCTION = YES; 295 | GCC_WARN_UNUSED_VARIABLE = YES; 296 | MTL_ENABLE_DEBUG_INFO = NO; 297 | SDKROOT = iphoneos; 298 | SWIFT_COMPILATION_MODE = wholemodule; 299 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 300 | TARGETED_DEVICE_FAMILY = "1,2"; 301 | VALIDATE_PRODUCT = YES; 302 | }; 303 | name = Release; 304 | }; 305 | DC2764EF1BA54CC200B120DC /* Debug */ = { 306 | isa = XCBuildConfiguration; 307 | buildSettings = { 308 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 309 | CLANG_ENABLE_MODULES = YES; 310 | DEVELOPMENT_TEAM = ""; 311 | INFOPLIST_FILE = "SO-32541268/Info.plist"; 312 | LD_RUNPATH_SEARCH_PATHS = ( 313 | "$(inherited)", 314 | "@executable_path/Frameworks", 315 | ); 316 | PRODUCT_BUNDLE_IDENTIFIER = "com.swiftarchitect.SO-32541268"; 317 | PRODUCT_NAME = "$(TARGET_NAME)"; 318 | SWIFT_OBJC_BRIDGING_HEADER = "SO-32541268/SO-32541268-Bridging-Header.h"; 319 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 320 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 321 | SWIFT_VERSION = 4.0; 322 | }; 323 | name = Debug; 324 | }; 325 | DC2764F01BA54CC200B120DC /* Release */ = { 326 | isa = XCBuildConfiguration; 327 | buildSettings = { 328 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 329 | CLANG_ENABLE_MODULES = YES; 330 | DEVELOPMENT_TEAM = ""; 331 | INFOPLIST_FILE = "SO-32541268/Info.plist"; 332 | LD_RUNPATH_SEARCH_PATHS = ( 333 | "$(inherited)", 334 | "@executable_path/Frameworks", 335 | ); 336 | PRODUCT_BUNDLE_IDENTIFIER = "com.swiftarchitect.SO-32541268"; 337 | PRODUCT_NAME = "$(TARGET_NAME)"; 338 | SWIFT_OBJC_BRIDGING_HEADER = "SO-32541268/SO-32541268-Bridging-Header.h"; 339 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 340 | SWIFT_VERSION = 4.0; 341 | }; 342 | name = Release; 343 | }; 344 | /* End XCBuildConfiguration section */ 345 | 346 | /* Begin XCConfigurationList section */ 347 | DC2764D71BA54CC200B120DC /* Build configuration list for PBXProject "SO-32541268" */ = { 348 | isa = XCConfigurationList; 349 | buildConfigurations = ( 350 | DC2764EC1BA54CC200B120DC /* Debug */, 351 | DC2764ED1BA54CC200B120DC /* Release */, 352 | ); 353 | defaultConfigurationIsVisible = 0; 354 | defaultConfigurationName = Release; 355 | }; 356 | DC2764EE1BA54CC200B120DC /* Build configuration list for PBXNativeTarget "SO-32541268" */ = { 357 | isa = XCConfigurationList; 358 | buildConfigurations = ( 359 | DC2764EF1BA54CC200B120DC /* Debug */, 360 | DC2764F01BA54CC200B120DC /* Release */, 361 | ); 362 | defaultConfigurationIsVisible = 0; 363 | defaultConfigurationName = Release; 364 | }; 365 | /* End XCConfigurationList section */ 366 | }; 367 | rootObject = DC2764D41BA54CC200B120DC /* Project object */; 368 | } 369 | --------------------------------------------------------------------------------