You can copy C ++ code with Objective-C ++ frames for use in Swift code, including the Playground framework. Some of my frameworks include OpenCV libraries, and this works well in Swift with the right packaging. Unfortunately, I cannot use them on playgrounds due to the following error:
Playground execution failed: error: Couldn't lookup symbols: _OBJC_CLASS_$_MyClass
... where MyClass is a subclass of NSObject from my structure. In fact, no frameworks are available for the playground after I link to one of the OpenCV libraries (for example, after adding -lopencv_core to the “Other linker flags” in the build settings), do these characters have any actions with OpenCV (or C ++, for that matter).
I really like to develop small functionality on the playgrounds in the context of imported frameworks, where ultimately successful solutions will end up. In the same way, OpenCV is an important library for me, so playing with it on the playgrounds will be free (not to mention fun).
I am still using Swift 1.2 (OS 10.10.4) since I am going to post the update to the App Store, but I would be wondering if Swift 2 has any meaning in this regard. As for OpenCV, this is version 3.0.0, built with CMake and the default configuration.
Edit: just described this problem (better and more broadly than me) on Apple forums: https://forums.developer.apple.com/thread/6246
milos source share