代码如下
class GameManager: NSObject { var score = 0 static let defaultManager = GameManager() private override init() { } func addscore() { score += 10 } }