In Swift, how can I write pattern-matching with conditionals?