On 20 Aug 2018, at 14:27, Casey McDermott <supp...@turtlesoft.com> wrote:
> 
> Moving anything from Obj-C to C++ objects is easy, because the .mm file can 
> contain both.
> 
> Moving back is hard, because C++ can't reference Obj-C classes.

It can, but only if it’s either (a) in a .mm file, or (b) prepared to call the 
Objective-C runtime functions. You can include the Objective-C runtime from a 
C++ file, and you’ll get all the base types (so, not the Foundation or AppKit 
types, or any of your own, but you will get “id”, “Protocol”, “Class” and so 
on), and can make method calls using appropriate Objective-C runtime APIs. I’m 
not saying either of those would be better than what you’ve done, mind.

>>> I’d tentatively suggest that it’s likely that Swift will develop some means 
>>> of 
> interfacing more directly with C++ code in the future, which should make this 
> easier rather than harder.
> 
> This link says that C++ support is now marked "out of scope" in Swift 3.0:
> https://stackoverflow.com/questions/35229149/interacting-with-c-classes-from-swift
> I didn't find any mention of future support being planned.

Sure, that may well be the case. I can’t imagine anyone thinking it isn’t a 
desirable feature for Swift to have at some point, though, and Swift being Open 
Source, any of a very large pool of people and companies could work on this if 
they wanted. I think it’s inevitable that Swift will at some point develop 
better support for C++ objects.

Kind regards,

Alastair.

--
http://alastairs-place.net

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to