title: how to load data from Realm List
body: <p>I am loading messages from Realm database in the message list.</p>
  
  <pre><code>// loads all messages from database
      func loadMessages() {
          messages = List&lt;Message&gt;(realm.objects(Message.self))
          collectionView?.reloadData()
         }
  </code></pre>
  
  <p>Where messages is defined as:</p>
  
  <pre><code>var messages = List&lt;Message&gt;()
  </code></pre>
  
  <p>I defined realm instance as:</p>
  
  <pre><code>// realm instance
      let realm = try! Realm()
  </code></pre>
  
  <p>It was working fine with <code>swift3</code> but when I am migrated to <code>Swift 4</code>, I am getting error: </p>
  
  <blockquote>
    <p>Argument passed to call that takes no argument.
     Please help with this.
    <a href="https://i.stack.imgur.com/Knlyo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Knlyo.png" alt="enter image description here"></a></p>
  </blockquote>