I'm trying to load simple data stored in realm into uitableview in swift. But I don't want realm to load all of it at once, instead I want it to load chunk by chunk, everytime the user reaches the bottom of the table.
I've gone through all the basic documentation and several questions and discussions on stackoverflow and github, but nothing seems to be helpful.
This is my object -
class Numbers:Object {
@objc dynamic var numb = ""
@objc dynamic var name = ""
override class func primaryKey() -> String? {
return "numb"
}
}
And this is the very basic code -
override func viewDidLoad() {
super.viewDidLoad()
let realm = try! Realm()
try! realm.write {
let info = realm.objects(Numbers.self)
}
}
Now the following line -
let info = realm.objects(Numbers.self)
It will load all the data stored in the realm table at once, but I want to load only some of it at once.