title: How to check url is image or video?
body: <p>I <code>fetch</code>  API response and parse  pick  url in swift  . but i need to check is <strong>image</strong> url or <strong>video</strong> url :</p>
  
  <p>If i get image url then show image and if get video url then play video :</p>
  
  <pre><code> if let url = postMedia?.url{
  
      //need to check here 
    }
  </code></pre>
  
  <p>For example</p>
  
  <p>Here is my video url :</p>
  
  <p><a href="https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" rel="noreferrer">https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4</a><br>
  <a href="https://clips.vorwaerts-gmbh.de/big_buck_bunny.mov" rel="noreferrer">https://clips.vorwaerts-gmbh.de/big_buck_bunny.mov</a></p>
  
  <p>here is image url :</p>
  
  <p><a href="https://clips.vorwaerts-gmbh.de/big_buck_bunny.png" rel="noreferrer">https://clips.vorwaerts-gmbh.de/big_buck_bunny.png</a><br>
  <a href="https://clips.vorwaerts-gmbh.de/big_buck_bunny.jpg" rel="noreferrer">https://clips.vorwaerts-gmbh.de/big_buck_bunny.jpg</a></p>
  
  <p>note : i know how to show image and play video </p>