Skip to content

Instantly share code, notes, and snippets.

@ThuggishNuggets
Created June 7, 2017 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThuggishNuggets/36674089d7d6ce2d00c007e32c332d9b to your computer and use it in GitHub Desktop.
Save ThuggishNuggets/36674089d7d6ce2d00c007e32c332d9b to your computer and use it in GitHub Desktop.
Variadic Function Overload Workaround
// ... 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