Singleton class for sharing data
问题 I'm an android app developer and a beginner in swift. I'm trying to implement a singleton class whose data members are shared throughout the app (like Settings). Getting this done in android is pretty simple but I'm breaking my head to do it in swift. Below is the code I've tried .. public class DataSet { public var notificationOnOff: Bool! public var interval: Int! public var alert: String! init() { self.notificationOnOff = true self.interval = 1; self.alert = nil; } init (onOff: Bool) {