Skip to content

Instantly share code, notes, and snippets.

@ennioma
Created July 6, 2017 22:00
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ennioma/81d5cedfc9bfbae660b0845e764c4f32 to your computer and use it in GitHub Desktop.
import Foundation
import RealmSwift
class FooObject {
let context: StorageContext
init(context: StorageContext) {
self.context = context
}
func dummyMethod(completion: @escaping ((Bool) -> Void)) {
self.context.fetch(Object.self, predicate: nil, sorted: nil) { (objects) in
(objects.count > 10) ? completion(true) : completion(false)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment