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
Post a Comment