ios - Create nested table view or separate page? -
i'm trying create options page ios app. have array of categories this:
var options = [ "location", "calculation method", "juristic method", "manual adjustment", "daylight saving time" ] then loading them in view controller this:
func tableview(tableview: uitableview, numberofrowsinsection section: int) -> int { return options.count } func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let cell = uitableviewcell(style: .default, reuseidentifier: "cell") cell.textlabel?.text = options[indexpath.row] return cell } this give me single table view perfectly! i'm trying handle click of each row bring list of options category. example, location have switch enable gps or allow them select location drop downs or map. calculation method bring table view of check marks. daylight saving time bring single row switch.
my question best approach this? should create dictionary of arrays hold options , reuse table, or should create separate view each category of options? i'm finding conflicting or outdated tutorials on , i'm having trouble converting examples objective-c. or direction appreciated!
i'd suggest creating separate views each category of options. example above, you'd end 5 more view controllers: location, calculation methods, juristic method, manual adjustment, , daylight saving time. , calculation methods, since it's table view of check marks, i'd have array stores each option inside calculationmethodsviewcontroller. same others. if need other data display, put in new view controllers - not in original view controller.
Comments
Post a Comment