If you'd like more context to the conversation:
How do I: Cast an optional string to NSString 
<http://ericasadun.com/2016/10/08/how-do-i-cast-an-optional-string-to-nsstring/>

-- E


> On Oct 9, 2016, at 6:59 PM, Anton Zhilin <[email protected]> wrote:
> 
> A quick fix:
> 
> guard let value = dict["Key"].map({ $0 as NSString }) {
>     use(value)
> }
> Current behavior is quite logical: main purpose of as? is to perform casts, 
> which are not guaranteed to succeed. But I’d say that as? should also support 
> what you want.
> 

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to