• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: swift and objective-c
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >swift and objective-c (From: "McLaughlin, Michael P." <email@hidden>)
 >Re: swift and objective-c (From: Chris Lattner <email@hidden>)
 >Re: swift and objective-c (From: Andreas Mayer <email@hidden>)

  • Prev by Date: Re: swift and objective-c
  • Next by Date: Re: swift and objective-c
  • Previous by thread: Re: swift and objective-c
  • Next by thread: Re: swift and objective-c
  • Index(es):
    • Date
    • Thread