Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Singleton/Swift/singleton.swift
Normal file
11
Task/Singleton/Swift/singleton.swift
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
class SingletonClass {
|
||||
|
||||
static let sharedInstance = SingletonClass()
|
||||
|
||||
///Override the init method and make it private
|
||||
private override init(){
|
||||
// User can do additional manipulations here.
|
||||
}
|
||||
}
|
||||
// Usage
|
||||
let sharedObject = SingletonClass.sharedInstance
|
||||
Loading…
Add table
Add a link
Reference in a new issue