Created
June 7, 2017 20:46
-
-
Save ThuggishNuggets/36674089d7d6ce2d00c007e32c332d9b to your computer and use it in GitHub Desktop.
Variadic Function Overload Workaround
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
// ... more code ... | |
public static func sync(keys: String...) { | |
sync(keys: keys) | |
} | |
public static func sync(keys: [String]) { | |
switch sharedInstance.dataStoreWithLatestData() { | |
case .Local: | |
printGeneralSyncStatus(false, destination: .Remote) | |
sharedInstance.syncSpecificKeys(keys, dataStore: .Local) | |
printGeneralSyncStatus(true, destination: .Remote) | |
case .Remote: | |
printGeneralSyncStatus(false, destination: .Local) | |
sharedInstance.syncSpecificKeys(keys, dataStore: .Remote) | |
printGeneralSyncStatus(true, destination: .Local) | |
} | |
} | |
// ... more code ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment