I have this code where I populate an array:
func loadObjectsFromRealm() {
private var myObjects: [MyObjects] = []
guard let realm = try? Realm() else { return }
myObjects = realmUtility.getAll(realm)
}
how can I check if the object is nil or not when I am going to use them? For example:
func getFirst() {
var myFirstObj = myObjects[0]
}
Is there something to check if the object myFirstObject
is real or not?