self = wed
println("Wednesday")
case mon:
self = thurs
println("Thursday")
case tue:
self = fri
println("Friday")
case sat:
self = sat
println("Saturday")
default:
println("NO Such Day")
}
}
}
var res = days.wed
res.print()
When we run the above program using playground, we get the following result:
Wednesday
Initializer Requirements
Swing allows the user to initialize protocols to follow type conformance similar to that of
normal initializers.
Syntax
protocol SomeProtocol {
init(someParameter: Int)
}
For example