title: How to implement MVC in Swift?
body: <p>I've been building Swift apps where basically all the functionality is in the ViewController. I know this isn't the optimal way to do it because design patterns help you expand the app but I don't really understand them. I keep reading articles about splitting up the Model, View and Controller but the articles don't give me answers on how to do it.</p>
  
  <p>Currently I'm building an app. I've made all the functions in the ViewController again but I've split the functions up between the three sections.</p>
  
  <p>My whole app is split up like this:</p>
  
  <pre><code>//Model
  func stopMonitoring(_ song:Song) {
      for region in locationManager.monitoredRegions {
          guard let circularRegion = region as? CLCircularRegion, circularRegion.identifier == song.identifier else { continue }
          locationManager.stopMonitoring(for: circularRegion)
      }
  }
  
  //View
  func addToView(_ song:Song){
      mapView.addAnnotation(song)
      mapView.add(MKCircle(center: song.coordinate, radius: song.radius))
  }
  </code></pre>
  
  <p>How do I go about turning this into a Model-View-Controller design? </p>
  
  <hr>
  
  <p>My thoughts have been to make separate classes of each and have them always loading but I have variables in the controller class that I use in them all which seems like it wouldn't be an efficient way to go about things. I've also heard about sharedinstances but again don't know how they come into play.</p>