heights = [67.5, 65.7, 64.3, 61.1, 58.5, 60.3, 64.9]
let greatestHeight = heights.max()
print(greatestHeight)
// Prints &quot;Optional(67.5)&quot;</code></pre>

<p><strong>Returns:</strong> The sequence&#39;s maximum element. If the sequence has no
  elements, returns <code>nil</code>.</p>

<p><strong>See Also:</strong> <code>max(by:)</code></p>

    <h4>Declaration</h4>    
    <code class="language-swift">@warn_unqualified_access
     func max() -&gt; LazyFilterSequence&lt;Base&gt;.Iterator.Element?</code