12 lines
267 B
Swift
12 lines
267 B
Swift
|
|
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
|