Thank you for your continuous support.
Do you know the format name of the code below?
It doesn't seem to initialize the closure (because there is no =).
I asked you a question because I didn't understand when I looked it up.
var value: String?{return"abc"}
print(value!)//abc
Thank you for your cooperation.
swift3
I'm sorry.
Self-resolved.
The way the get, set of properties is described is to omit get.
In this case, it is read-only.
var value: String?{return"abc"}
print(value!)
// value = "ABC" ... Error because it is read-only
Thank you.
© 2024 OneMinuteCode. All rights reserved.