import UIKit
final class Singleton {
static let sharedInstance = Singleton()
private init() { }
var value = ""
}
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let a = Singleton.sharedInstance
a.value = "a"
let b = Singleton.sharedInstance
b.value = "b"
print(a.value) // b
print(b.value) // b
}
}