Re: 'Bool' is not convertible to 'BooleanLiteralConvertible'
Re: 'Bool' is not convertible to 'BooleanLiteralConvertible'
- Subject: Re: 'Bool' is not convertible to 'BooleanLiteralConvertible'
- From: Quincey Morris <email@hidden>
- Date: Mon, 27 Jul 2015 22:18:23 +0000
On Jul 27, 2015, at 15:08 , Rick Mann <email@hidden> wrote:
>
> Is it bridged automatically anywhere else? Seems like a lot of ad-hoc and inconsistent support for bridging.
I dunno, really. Support for CF things (and C things and unmanaged pointers) seems to vary release by release, so I don’t try to keep up.
Bridging is consistent, though, I believe. It’s very specific:
Int,etc <-> NSNumber
String <-> NSString
[AnyObject] <-> NSArray
[NSObject: AnyObject] <-> NSDictionary
But this doesn’t extend to things we know about Obj-C and Cocoa externally to Swift, or internally about the implementations (such as toll-free bridging between CF and NS types). Remember, too, that we had to cast CFString variables like kSecReturnData to NSString manually in Obj-C to shut the compiler up.
P.S. In my earlier example, ‘as String’ seems to work as well as ‘as NSString’. I presume that’s because of bridging, once you’ve got as far as NSString.
_______________________________________________
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