Skip to content

Instantly share code, notes, and snippets.

@markst
Created March 16, 2017 05:48
Show Gist options
  • Save markst/98474657682dd041deff63d384e74ba2 to your computer and use it in GitHub Desktop.
Save markst/98474657682dd041deff63d384e74ba2 to your computer and use it in GitHub Desktop.
class MyOperation: Operation {
open func execute() {
let realm = try! Realm(configuration: Realm.Configuration(inMemoryIdentifier: "MyInMemoryRealm"))
// Do some stuff
networkClient.request(method: method, url: url, payload: payload) { statusCode, responseData, networkError in
// Now do some stuff on original operation threafd
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment