+ 2

Type Properties

In the block of code below, is computedProp a variable? How is computedProp different from an int function that simply returns value 4? class SomeClass { static var storedProp = "Some value." static var computedProp: Int { return 42 } } print(SomeClass.storedProp) print(SomeClass.computedProp)

13th Apr 2020, 7:54 AM
Daniyal Dianati
Daniyal Dianati - avatar
2 ответов
0
Which language it is?
18th Apr 2020, 12:29 PM
Azizjon Dekhkanov
Azizjon Dekhkanov - avatar
0
swift
8th Oct 2024, 9:05 PM
podle Playz
podle Playz - avatar