SyncEngine
open class SyncEngine: NSObject
SyncEngine is framework to Sync Data from Server. It syncs application’s Colors, Constants, Font Sizes/Styles and Texts/ Strings.
-
Holds Last Synced Server Data
Declaration
Swift
open static var lastSyncedServerDate:String?
-
Static Initializer for Sync Engine.
- Parameters:
- urlToSync: Http request url for Sync data
- authentication: Authentication Header if any
Declaration
Swift
public static func initialize(_ urlToSync:String, authentication:[String:String]? = nil)Parameters
urlToSyncHttp request url for Sync data
authenticationAuthentication Header if any
- Parameters:
-
Method to retrieve value for a given key of SyncEngine.
Parameter
Parameter aKey: key from SyncEngineReturns
A generic value for a given key.Declaration
Swift
public class func objectForKey<T>(_ aKey: String?) -> T?Parameters
aKeykey from SyncEngine
Return Value
A generic value for a given key.
-
This method is used to sync an object with SyncEngine.
- Parameters:
- anObject: A SyncEngine object
- aKey: A key of SyncEngine
Declaration
Swift
public class func syncObject(_ anObject: AnyObject, forKey aKey: String)Parameters
anObjectA SyncEngine object
aKeyA key of SyncEngine
- Parameters:
-
Sync Data from a Key value pair.
Parameter
Parameter dict: NSDictionaryReturns
Flag for success or failure.Declaration
Swift
@discardableResult public class func syncForData(_ dict:NSDictionary) -> BoolParameters
dictNSDictionary
Return Value
Flag for success or failure.
-
This static method should be called in applicationDidBecomeActive method of AppDelegate to sync data from Server.
Declaration
Swift
public static func syncData()
View on GitHub
SyncEngine Class Reference