Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

Swift Create static type Singleton Object

class FileManager {
  
  // static property to create singleton
  static let fileObj = FileManager()
  ... 
}

// access the singleton 
let data = FileManger.fileObj
 
PREVIOUS NEXT
Tagged: #Swift #Create #static #type #Singleton #Object
ADD COMMENT
Topic
Name
4+5 =