i'm creating app shows data in uitableview. data contains location information, want add mapview display data. when user taps uitableviewcel, need segue uitableview show detailed data. still want show mapview same data above detailed data, , still want navigationbar update, i.e. buttons returns user first uitableview.
in image form make easier understand
i thinking of making subclass of uinavigationcontroller , putting container underneath mapview, don't know go there.
have vc0 embedded in navigation controller or subclass uinavigationcontroller. create info viewcontroller , push on navigation controller.
in particular case you'll want use didselectrowat method uitableviewdelegate.
func tableview(_ tableview: uitableview, didselectrowat indexpath: indexpath) { // use indexpath.section , indexpath.row use data let infovc = yourinfoviewcontroller() infovc.title = "info cell name" navigationcontroller?.pushviewcontroller(infovc, animated: true) }
edit after first comment:
i'm not sure best way of doing 1 way can is:
- modify table view based on being shown, ie: first set of data or cell detail data
- update navigation bar's title , left bar buttons per set of data you're displaying
- one of buttons appear in cell detail data set , sets switch displaying first set of data
Comments
Post a Comment