Reputation: 235
var aa: (()?) = (john.residence?.address = someAddress)
var bb: ()? = john.residence?.printNumberOfRooms()
Is this to distinguish whether only nil?
Upvotes: 3
Views: 190
Reputation: 10195
()
is the empty tuple type (same as Void
).
()?
is the optional version of that.
(()?)
is a tuple containing the type ()?
so reduces to just ()?
Upvotes: 6