Re: swift and objective-c
Re: swift and objective-c
- Subject: Re: swift and objective-c
- From: Marco S Hyman <email@hidden>
- Date: Sun, 08 Jun 2014 14:50:19 -0700
>> a) -forwardInvocation:
>
> No equivalent — as I said earlier, Swift’s default method dispatch is less dynamic than Obj-C.
I wonder...
forwardInvocation: is invoked by the run time. If mixing obj-C
and Swift would not the run time invoke a Swift method named
forwardInvocation( anObj: NSInvocation ) if it exists?
Just guessing.
> Without the dynamic lookup of the selector, however, it’s supported with a very elegant & compact syntax:
>
> let result = self.methodName?(someObject)
if let result = self.methodName?(someObject) {
// handle result here
}
I think that is the appropriate pattern.
_______________________________________________
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