[Solved] Singleton class with instance variable and methods in Swift (iOS)
i got the solution, when i tried this, worked fine! class ABC_Util { var doesValueExists:Bool = false var arrValues:NSMutableArray? = nil class var sharedInstance: ABC_Util { struct ABC_UtilSingleton { static let instance = ABC_Util() } return ABC_UtilSingleton.instance } init() { self.doesValueExists = self.checkValueExists() self.arrValues = self.getArrayOfValues() } //method internal func checkValueExists()-> Bool { //return true/false … Read more