// Using the modulo operator even: func (n: Int) -> Bool { (n % 2) == 0 } // Using bitwise and odd: func (n: Int) -> Bool { (n & 1) == 1 }