Use Custom TableViewController or ViewController for this layout with Swift and XCode for iOS?

时间:2015-12-10 01:18:40

标签: ios xcode swift uikit swift2

I'm new to software development and am working on a test project that allows me to add items to a list. I've found countless tutorials which showcase the basic structure for this, and have gotten up to this point:

I'm creating a UITableView that includes several items and their corresponding price in a list format. The tableview contains a list key and price key in the cell. If the Add button is clicked in the navigation menu, it leads to the attached screen where each item can be added to the tableView if both the namekey and pricekey are filled out before clicking save. I want the Viewcontroller for this to send each item back to the original listview, but i'm not sure if I should use a UITableViewController or UIViewController, or UICollectionViewController for the layout in Xcode, as well as how to implement this functionality.

Any tips or clarification would be greatly appreciated! :)

List Controller and Add Controller

1 个答案:

答案 0 :(得分:0)

查看我几天前回答的类似问题。该链接包含有问题的用户的示例代码,因此您也可以下载该代码,以便了解如何执行此操作:NSUserDefaults not working with UITableView in Swift

在另一个问题中,该人试图解决保存数据的问题,这也是您可能想要做的事情。