jeudi 1 septembre 2016

What is right requirement to create Model Classes in my iOS app?

I am using SwiftJSON to parse my data which I receive after making Alamofire call. API gives me event list like following

[

    {
        "eventData": "someDate",
        "eventTitle": "someTitle",
        .
        .
        so on
    }

    {
        "eventData": "someDate",
        "eventTitle": "someTitle",
        .
        .
        so on
    }

]

I will show this in TableView and will use the same data in some other ViewControllers. I don't see any need of creating an Event model class and do a mapping with JSON response. I can save the data as SwiftyJSON's JSON struct and use the same everywhere else. Is it a good software design approach ? What advantage will I get if have model classes of every data which is coming from API ?

Aucun commentaire:

Enregistrer un commentaire