Post

Replies

Boosts

Views

Activity

Comment on Type Properties in Extensions
I still don't understand how it is a computed property. Here is an example from the Swift Language Guide under the "Type Property Syntax" header: struct SomeStructure { static var storedTypeProperty = "Some value." static var computedTypeProperty: Int { return 1 } } The constant sampleData looks like a stored type property because it is being initialized to a default property value.
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’22