3 ms·
I want to like this answer but not sure it's true. Do you mean bridging ObjectiveC++ and Swift? Apple is now deprecating ObjectiveC++ (after all the work we w
by gumby 7y ago
I want to like this answer but not sure it's true. Do you mean bridging ObjectiveC++ and Swift? Apple is now deprecating ObjectiveC++ (after all the work we went to to make it work back in the NeXT days).
I would like to integrate C++ code into a SwiftUI app but am not sure how to do it. Are there some iOS C++ APIs I'm overlooking?
- saagarjha 7y ago> Apple is now deprecating ObjectiveC++ How so? Objective-C++ drives a number of Apple projects, so I don't see how they're deprecating it.
- gumby 7y agoDocumentation seems to have vanished.
- armadsen 7y agoApple’s documentation for all sorts of things is in a sorry state lately. That includes mass “retiring” of perfectly good documentation for non-deprecated things with no replacement. I wouldn’t take missing or hard-to-find documentation for any specific thing as an indication that it’s deprecated. As far as I know, Objective-C++ is as supported as ever. That is to say, it’s not exactly a banner feature, but it works fine, and there’s no reason not to use it if it’s the best solution to your particular problem. I use it in a number of places, including to expose C++ code to Swift, which doesn’t interop directly with C++.
- pjmlp 7y agoPicking on sibling comment, you can still reach for the document, all what is required is a little experience as Apple developer on how documentation get shifted around. https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/OOPandObjC1/Articles/ocLanguage.html#//apple_ref/doc/uid/TP40005191-CH7-BCIDBAEA https://developer.apple.com/library/archive/documentation/Co... Sadly the new manuals are pretty lousy.
- pjmlp 7y agoSo far I never saw anything in that regard. In any case it isn't as if extern "C" isn't part of the language. My answer regards using only SDK available languages, not that you write 100%bof the app in one of them
- layoutIfNeeded 7y ago> Apple is now deprecating ObjectiveC++ I’d be very surprised if this was true. Apple’s own frameworks are all C++ under the hood, e.g. CoreAnimation, AVFoundation, AutoLayout (part of UIKit and AppKit), Metal, etc. The meat of these frameworks is in C++ with an Objective-C++ layer on top, exposing an Objective-C (and thus Swift) API to developers.