3 ms·
Swift handles this exact problem quite elegantly with the "if case let" construct, allowing you to destructure sum types directly within an if statement. https
by brandonhorst 7y ago
Swift handles this exact problem quite elegantly with the "if case let" construct, allowing you to destructure sum types directly within an if statement.
https://alisoftware.github.io/swift/pattern-matching/2016/05/16/pattern-matching-4/ https://alisoftware.github.io/swift/pattern-matching/2016/05...