Re: Swift binding of NSEnumerator subclasses
Re: Swift binding of NSEnumerator subclasses
- Subject: Re: Swift binding of NSEnumerator subclasses
- From: Quincey Morris <email@hidden>
- Date: Thu, 25 Feb 2016 15:25:24 -0800
- Feedback-id: 167118m:167118agrif8a:167118s2Q4-kCAu7:SMTPCORP
On Feb 25, 2016, at 15:03 , Jens Alfke <email@hidden> wrote:
It also happens with NSDirectoryEnumerator, an NSEnumerator subclass declared in <Foundation/NSFileManager.h>. NSEnumerator is parameterized, and so is NSDirectoryEnumerator, and NSFileManager’s method enumeratorAtURL: returns an NSDirectoryEnumerator<NSURL>.
In fact, the Swift NSDirectoryEnumerator just isn’t generic at allIn the Obj-C headers, NSEnumerator and NSDirectoryEnumerator are both annotated with “<AnyObject>”. enumeratorAtURL’s return value is annotated as “NSDirectoryEnumerator <NSURL*>”.
However, if you command-click on enumeratorAtURL in Swift code, you’ll see that the generated header doesn’t have NSURL in the return type. I’m not sure what’s supposed to happen in this situation. Are there any Swift generics produced from Obj-C annotations *other than* collection classes? I’ve got a feeling that the answer is no.
|
_______________________________________________
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