Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

Initializer Swift

class Wall {
  
  var length: Double
  ...
  
  // initializer with parameter
  init(length: Double) {

    self.length = length
  } 
}

// create an object
var wall1 = Wall(length: 10.5)
 
PREVIOUS NEXT
Tagged: #Initializer #Swift
ADD COMMENT
Topic
Name
5+1 =