Menu bar using dynamic behavior in Swift