Assuming we have an enum with associated values:
enum MyTimer {
case describe(userId: String,
endTime: Int)
case vote(endTime: Int)
}
Can we define a function with a specific case of this enum as argument type, like:
func onDescribeTimerChange(timer: MyTimer.describe) {
print(timer.userId)
}
This is the syntax I would use with a Kotlin sealed class because it makes it clear which case of the enum the function is designed for. But currently the Swift compiler rejects it with the message:
Enum case 'Describe' is not a member type of 'MyTimer'