ios - Swift3, How to use same UITableView in different viewController -


in project, have table including many cell prototypes, outlets , constraints in xviewcontroller class. know how if want use table again in yviewcontroller class.

is possible or have create new one?

you can use containerview same. can take separate uitableviewcontroller or uiviewcontroller per requirement.let called class commontableviewcontroller.

in xviewcontroller , remove tableview , move code commontableviewcontroller. drag , drop container view object library on xviewcontroller. can delete pre- defined child of containerview. add embed segue between xviewcontroller , commontableviewcontroller.

drag , drop container view on yviewcontroller , add segue mentioned above.

do let me know if have further queries.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -