Re: Error unwrapping an optional which isn't an optional
Re: Error unwrapping an optional which isn't an optional
- Subject: Re: Error unwrapping an optional which isn't an optional
- From: Charles Srstka <email@hidden>
- Date: Mon, 21 Sep 2015 20:58:35 -0500
> On Sep 21, 2015, at 6:03 PM, Greg Parker <email@hidden> wrote:
>
> selectedRow's "row index or -1" behavior is an obvious candidate for a Swift optional, but we don't currently have a good way to bridge such API with Objective-C.
How about allowing the “nullable” keyword on non-pointer types, but adding a parameter that specifies the nil condition? An API like selectedRow could simply have nullable(-1) added to its type, and then Swift could interpret the value as nil if it encountered a -1 from that API.
Charles
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden