IssueRaiser

Awesome, the ability to unwrap multiple optionals on one line should be bolded, underlined and all caps at the top of this article.

Awesome, the ability to unwrap multiple optionals on one line should be bolded, underlined and all caps at the top of this article. Seriously though, this is an everyday pain point that happens all the time when writing Swift. Glad Apple is listening to developer feedback on this stuff. Translation for those unfamiliar with Swift: Swift has a relatively strong type system. If a variable in Swift can be null at any point, it must be explicitly declared so as part of its type (e.g. an integer that can be null has the type "Int?", an integer that cannot be null has the type "Int"). Swift has a way to 'unwrap' these optional values and do things with them if they exist. Prior to this release, unwrapping multiple optional things required a bunch of nested if statements. With this release, unwrapping multiple optional values can be done in one if statement.

Posted by ruddct on Feb 9, 2015, 8:20 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.8,000 issues0 comments

hackernews (Other)

Awesome, the ability to unwrap multiple optionals on one line should be bolded, underlined and all caps at the top of this article.

ruddctFeb 9, 2015, 8:20 PM

Awesome, the ability to unwrap multiple optionals on one line should be bolded, underlined and all caps at the top of this article. Seriously though, this is an everyday pain point that happens all the time when writing Swift. Glad Apple is listening to developer feedback on this stuff. Translation for those unfamiliar with Swift: Swift has a relatively strong type system. If a variable in Swift can be null at any point, it must be explicitly declared so as part of its type (e.g. an integer that can be null has the type "Int?", an integer that cannot be null has the type "Int"). Swift has a way to 'unwrap' these optional values and do things with them if they exist. Prior to this release, unwrapping multiple optional things required a bunch of nested if statements. With this release, unwrapping multiple optional values can be done in one if statement.

Comments (0)

No comments yet. Start the discussion.

Comment on this issue