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