ios - Swift prepopulate modal content before opening -
i unable find answer of in swift 3 there way pre-populate modal view controller data before opening it? i'm thinking not believe modal view controller won't exist @ point.
here i'm trying achieve. have modal contains table view bound data used filter content on parent controller. parent controller has pass data modal used in it's table view (i having init in modal controller). have delegate going parent modal content in modal same looking way set modal table view data don't have rebind every time opened how following done.
func presentmodal(){ let modalvc = roadwaysviewcontroller(roadways: roadways) modalvc.modalpresentationstyle = .popover modalvc.preferredcontentsize = cgsize(width: 300, height: 350) modalvc.delegate = self self.present(modalvc, animated: true) }
the problem roadways same, binding same data on , over. there way around this?
give modally presented view controller variable hold data,
var data: [mystruct]?
and set when set it's delegate. or give knows data pull data model. pass earliest date want data from.
Comments
Post a Comment