Page 125

Swift

enum Enumname { static var storedTypeProperty = " " static var computedTypeProperty: Int { // return an Int value here } }

class Classname { class var computedTypeProperty: Int { // return an Int value here } }

Querying and Setting Properties Just like instance properties Type properties are queried and set with '.' Syntax just on the type alone instead of pointing to the instance. struct StudMarks { static let markCount = 97 static var totalCount = 0 var InternalMarks: Int = 0 { didSet { if InternalMarks > StudMarks.markCount { InternalMarks = StudMarks.markCount } if InternalMarks > StudMarks.totalCount { StudMarks.totalCount = InternalMarks } } } }

var stud1Mark1 = StudMarks() var stud1Mark2 = StudMarks()

stud1Mark1.InternalMarks = 98 113

​Quick is a effective and user-friendly coding language for macOS, iOS, watchOS and tvOS....  

...

Read more
Read more
Similar to
Popular now
Just for you