title: is this example is mvc method or not
body: <p>is this the way to code for mvc?</p>
  
  <p>model:-</p>
  
  <pre><code>typealias JSONDictionary = [String:Any]
  
  class EventModel: NSObject {
  
      var name :String!
        init?(dictionary :JSONDictionary) {
  
          guard let name = dictionary["name"] as? String else{
  
                  return
          }
  
          self.name = name
             }
  }
  </code></pre>
  
  <p>datasourcemodel:-</p>
  
  <pre><code>class EventDataSourceModel: NSObject {
  
      var dataListArray:Array&lt;EventModel&gt;? = []
  
  
      init(array :Array&lt;[String:Any]&gt;?) {
          super.init()
          var newArray:Array&lt;[String:Any]&gt; = []
          if array == nil{
  
              newArray = self.getJsonDataStored2()
          }
          else{
              newArray = array!
  
          }
  
          var datalist:Array&lt;EventModel&gt; = []
          for dict in newArray{
  
              let model = EventModel(dictionary: dict)
  
              datalist.append(model!)
          }
          self.dataListArray = datalist
      }
  }
  
  typealias dummyDataSource2 =  EventDataSourceModel
  extension dummyDataSource2{
  
      func getJsonDataStored2() -&gt;Array&lt;Dictionary&lt;String,String&gt;&gt;{
  
          let jsonArray = [["id":"201","name":"Dosa Fest","imageurl":"","location":"Doha,Qatar","date":"Jan 2018","place":"Shiraz Garden"],["id":"202","name":"Organic Vegan Fest","imageurl":"","location":"Doha,Qatar","date":"15 Jan 2018 30 Jan 2018","place":"Evergreen Organics"],["id":"203","name":"Food Of Life Time","imageurl":"","location":"Doha,Qatar","date":"Jan 2018","place":"Turkey Central"],["id":"204","name":"Tea Time","imageurl":"","location":"Doha,Qatar","date":"Jan 2018","place":"Doha Food Mall"],["id":"205","name":"Dosa Fest","imageurl":"","location":"Doha,Qatar","date":"Jan 2018","place":"Shiraz Garden"],["id":"206","name":"Organic Vegan Fest","imageurl":"","location":"Doha,Qatar","date":"15 Jan 2018 30 Jan 2018","place":"Evergreen Organics"],["id":"207","name":"Food Of Life Time","imageurl":"","location":"Doha,Qatar","date":"Jan 2018","place":"Turkey Central"],["id":"208","name":"Tea Time","imageurl":"","location":"Doha,Qatar","date":"Jan 2018","place":"Doha Food Mall"]] as Array&lt;Dictionary&lt;String,String&gt;&gt;
  
          return jsonArray
      }
  }
  </code></pre>
  
  <p>controller:-</p>
  
  <pre><code>class EventViewController: UIViewController ,UITableViewDataSource{
  
      @IBOutlet private weak var tableView: UITableView!
  
      var datasourceModel:EventDataSourceModel!
  
      init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?, withdatasourcemodel datasource:EventDataSourceModel) {
  
          super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
  
         datasourceModel = datasource
  
      }
      required init?(coder aDecoder: NSCoder) {
          fatalError("init(coder:) has not been implemented")
      }
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
      }
  
      func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          return (datasourceModel.dataListArray?.count)!
  
      }
      func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
  
  
          let identifier = "eventcell"
          var cell: EventCell! = tableView.dequeueReusableCell(withIdentifier: identifier) as? EventCell
  
          if cell == nil {
              tableView.register(UINib(nibName: "EventCell", bundle: nil), forCellReuseIdentifier: identifier)
              cell = tableView.dequeueReusableCell(withIdentifier: identifier) as? EventCell
          }
  
          cell.setEventData(events:datasourceModel.dataListArray![indexPath.row])
  
          return cell
      }
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  }
  </code></pre>
  
  <p>finally view:-</p>
  
  <pre><code>class QM_EventCell: UITableViewCell {
  
      @IBOutlet weak var name: UILabel!
      @IBOutlet weak var location: UILabel!
      @IBOutlet weak var date: UILabel!
      @IBOutlet weak var imageurl: UILabel!
      @IBOutlet weak var place: UILabel!
  
  
      @IBOutlet weak var images: UIImageView!
  
      override func awakeFromNib() {
          super.awakeFromNib()
          // Initialization code
  
      }
  
      func setEventData(events:QM_EventModel)
      {
          self.name.text = events.name
  
      }
      override func setSelected(_ selected: Bool, animated: Bool) {
          super.setSelected(selected, animated: animated)
  
          // Configure the view for the selected state
      }
  
  }
  </code></pre>
  
  <p>I am new to this field.I am own learning .So i don,t know whether the method doing is correct or wrong.i need to develop the project using mvc.For that i refer many website about mvc method using swift.i know to do in mvvm ,but how the changes will come to mvc i am little bit confusion .
  Is this way needed to separate.Or if wrong please tell how to do</p>