Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

Swift Static Properties

class University {

  // static property 
  static var name: String = ""
  ...  
}
Comment

Swift static Property

class University {

 // static property
 static var name: String = ""

 // non-static property
 var founded: Int = 0
}

// create an object of University class
var obj = University()

// assign value to static property
University.name = "Kathmandu University"
print(University.name)

// assign value to non-static property
obj.founded = 1991
print(obj.founded)
Comment

PREVIOUS NEXT
Code Example
Swift :: printf in swift 
Swift :: Swift nal Within The Same Module 
Swift :: how to limit ui field in ios 
Swift :: after redirect from another viewcontroller in swift 5 make full view view controller 
Swift :: swift disable modal dismiss swift 
Swift :: UINavigationBar turns black 
Swift :: how to screen record swift stackoverflow 
Swift :: table flutter stackoverflow 
Swift :: Swift is case-sensitive. So A and a are different variables 
Swift :: swift singleton 
Swift :: Swift break statement with nested loops 
Swift :: ios swift local storage with icloud 
Swift :: Swift Access Elements from Dictionary 
Swift :: swift integer 
Swift :: SwifUI call the function in the cordinator 
Swift :: Blinking effect on UILabel 
Swift :: Swift Find Number of Array Elements 
Swift :: swift navigationbar not working 
Swift :: swift get all cases starting with 
Swift :: Swift s for complex types 
Swift :: swift ge array item from indexset 
Ruby :: ruby array group by attribute 
Ruby :: rails uniqueness 
Ruby :: Your Ruby version is 2.6.8, but your Gemfile specified 2.7.5 
Ruby :: ruby intersection of two arrays 
Ruby :: ruby filter 
Ruby :: ruby different ways to run string interpolation 
Ruby :: rename column in db rails 
Ruby :: ruby 
Ruby :: how to add to array ruby 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =