Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. static func getInfoById(id: String) -> DataInfo {
  2. let scope = DataInfo ()
  3. let realm = try! Realm()
  4. scope = realm.objects(DataInfo.self).filter("IdInfo == %@", id)
  5. return scope
  6. }
  7.  
  8. static func getInfoById(id: String) -> DataInfo {
  9. let realm = try! Realm()
  10. let scope = realm.objects(DataInfo.self).filter("IdInfo == %@", id)
  11. return scope.first!
  12. }
  13.  
  14. static func getInfoById(id: String) -> DataInfo? {
  15. let realm = try! Realm()
  16. let scope = realm.objects(DataInfo.self).filter("IdInfo == %@", id)
  17. return scope.first
  18. }
  19.  
  20. static func getInfoById(id: String) -> DataInfo {
  21. let realm = try! Realm()
  22. return realm.object(ofType: DataInfo.type, forPrimaryKey: id)
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement