简体   繁体   中英

Table Views & the Data Model for Swift example

I study Swift for the week and trying to create categories in my app.

I'm looking for the example that contains separation from categories to subcategories. I have found an old Apple documentation about my issue, but it's on Objective-C.

https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/TableView_iPhone/TableViewAndDataModel/TableViewAndDataModel.html

I would be very grateful if you would help me found/code an example project.

example: Imgur

So it seems like what you want to do is pretty basic. Following the traditional MVC pattern you can create a struct for categories, and sub catagories.

You'll also be using multiple table view controller so I would recommend using generic table view controller so it's more reusable.

One of my favorite iOS developer did a talk on generic tableview controller and I think it's worth watching. Here's the link: https://realm.io/news/tryswift-chris-eidhof-table-view-controllers-swift/

Sorry if this is not what you're looking for.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM