model view controller - Can somebody post a good example of MVC Pattern in Swift? -
a simple project has implemented mvc pattern. far,i have brief understanding of how want see practical implementation.
this typical example of model view controller in swift:
class article { var title: string var body: string var date: nsdate var thumbnail: nsurl var saved: bool } class articleviewcontroller: uiviewcontroller { var bodytextview: uitextview var titlelabel: uilabel var datelabel: uilabel var article: article { didset { titlelabel.text = article.title bodytextview.text = article.body let dateformatter = nsdateformatter() dateformatter.datestyle = nsdateformatterstyle.shortstyle datelabel.text = dateformatter.stringfromdate(article.date) } } }