This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class ArrayManager: NSObject { | |
static var singletonObjectObj : ArrayManager! | |
class func sharedInstance() -> ArrayManager { | |
guard (singletonObjectObj != nil) else { | |
singletonObjectObj = ArrayManager() | |
return singletonObjectObj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In App Delegate Add this | |
func applicationDidBecomeActive(_ application: UIApplication) { | |
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. | |
let updateManager : UpdateManager = UpdateManager.sharedManager() | |
updateManager.pListUrl = String(format: "%@", GlobalConstants.AppDownloadPlistURL) // GlobalConstants.AppDownloadPlistURL | |
updateManager.versionUrl = String(format: "%@", GlobalConstants.AppVersionURL) // | |
updateManager.checkForUpdates() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define SYNTHESIZE_SINGLETON_FOR_CLASS(classname) \ | |
\ | |
+ (id)allocWithZone:(NSZone *)zone \ | |
{ \ | |
@synchronized(self) \ | |
{ \ | |
if (shared##classname == nil) \ | |
{ \ | |
shared##classname = [super allocWithZone:zone]; \ | |
return shared##classname; \ |