Re: swift and objective-c
Re: swift and objective-c
- Subject: Re: swift and objective-c
- From: Jens Alfke <email@hidden>
- Date: Sat, 07 Jun 2014 14:22:44 -0700
On Jun 7, 2014, at 12:15 PM, Andreas Mayer < email@hidden> wrote: That's good to hear. Because while I would love an Objective-C without the C part, it seems that Swift is lacking in the 'objective' department too. Maybe I just missed it but there is nothing in the book about message passing or introspection.
By default Swift classes use vtable-based dispatch, which is of course less dynamic (but much more optimizable.) I haven’t seen any introspection APIs, but there’s not really any solid documentation of the standard library yet, so that doesn’t mean they don’t exist.
Swift classes that inherit from NSObject are Obj-C compatible and can be called using dynamic (objc_msgsend) dispatch, and I assume that the Obj-C introspection APIs can be used on them. Some types of methods aren’t bridged to Obj-C though, since they have semantics that don’t match; operator overloads are one example.
—Jens |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden