IMO, that is too idiosyncratic to be a standard language feature. You should 
extend Bool based on the specific needs of your application. Thats what the 
extensions are for. 

Best, 

 t. 

> On 04 Jun 2016, at 15:10, Arsen Gasparyan via swift-evolution 
> <[email protected]> wrote:
> 
> Hello,
> 
> It would be great if we had `init?(_ text: String)` for Bool class. Because 
> sometime when you're processing JSON/XML it can help you a lot.
> 
> Examples:
> 
> Bool("true") -> true
> Bool("false") -> false
> Bool("TrUE") -> true
> Bool(" true ") -> nil
> Bool("1") -> nil
> Bool("Y") -> nil
> Bool("whatever") -> nil 
> 
> 
> via https://bugs.swift.org/browse/SR-1282 
> <https://bugs.swift.org/browse/SR-1282>
> 
> Thanks.
> _______________________________________________
> swift-evolution mailing list
> [email protected]
> https://lists.swift.org/mailman/listinfo/swift-evolution

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

Reply via email to