Converter converts readonly class properties to class func's instead of static var's. If the property is defined readonly in header and implementation provides a computed value, the computation should not be converted to class function but a static variable with a closure with the code. It retains the meaning of the code better.
This sample should produce the following (see the statickeyword):
NOTE: we’re using staticinstead of classas in the Xcode’s Generated Interface (and the above article),
because only staticvariables can be initialized.
See this article for differences between static and class in Swift.
2. This sample (which includes getters and setters)
should merge (static) accessor method implementations into the (static) property declaration,
very similar to how regular (non-static) properties and methods are handled.
The output should be:
NOTE: here we are using classinstead of staticfor the printSelected property declaration to allow inheritance.
A quick test shows that in Objective-C, you can declare a class property with the same name in a subclass: https://take.ms/6BYVz
Conclusion: use class for static property with accessor(s) or static` or static property without accessors.