ios - how to make a single class for table view and inherit in all other classes? -


i want have table view in around 5 screens same layout. should best approach? should make single class , inherit other view controllers class? or make table view in each screens separate coding?

you should create subclass of uitableviewcell , use cell layout through app.

if need uitableview have same properties throughout, create uitableview extension (in swift)

extension uitableview {     class func defaulttableview() -> uitableview {         let tableview = uitableview()         // setup default tableview properies here         return tableview     } } 

Comments

Popular posts from this blog

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -

php - Prepared Statement Inner Join Cannot Pass Parameter by Reference -

c# - Value cannot be null or empty.\r\nParameter name: name -