title: One button that has multiple function - Swift
body: <p>I am making an <strong>action button</strong> that implements different function each time the button is pressed. When I clicked once, the map changes to <strong>satellite</strong> and when i clicked it again, it changes to <strong>standard</strong> and when i clicked it again, it changes to <strong>hybrid</strong> and when i clicked it again, it goes back to <strong>satellite</strong>.</p>
  
  <p>This is my code. Please let me know where did I do wrong. </p>
  
  <pre><code>    @IBAction func changeLayout(_ sender: AnyObject) {
      switch (sender.anyObject()) {
      case 0:
          mapView.mapType = MKMapType.satellite
      case 1:
          mapView.mapType = MKMapType.standard
      default:
          mapView.mapType = MKMapType.hybrid
      }
  
  }
  </code></pre>
  
  <p>The error that I got says:</p>
  
  <p>Expression pattern of type 'Int' cannot match values of type 'Any?' ViewController.swift</p>