What is the initial value of the delegate variable if no constructor is provided?
delegate
class Example { weak var delegate: Bool? }
Yes it is automatically set to nil if unassigned.
From Apple:
If you define an optional variable without providing a default value, the variable is automatically set to nil for you
2.1m questions
2.1m answers
60 comments
57.0k users