[swift-evolution] Swift's Optional Int as NSNumber in Objective-C

David Waite david at alkaline-solutions.com
Tue May 16 17:04:29 CDT 2017


> On May 15, 2017, at 8:24 AM, T.J. Usiyan via swift-evolution <swift-evolution at swift.org> wrote:
> 
> The argument is not about whether or not it should come through as an object. The argument is about the fact that *sometimes* it would come through as an object and other times it would not. Optionality isn't an obvious way to make that decision.
> 

A second argument is that NSNumber does not represent an integer - only that it can be *initialized* by an integer. So the semantics of Int? -> NSNumber as an outbound result are completely different than the semantics of NSNumber -> Int? as an inbound parameter.

-DW



More information about the swift-evolution mailing list