0

How to assign a viewController was the delegate to a custom UITableViewHeaderFooterView?

In file TableViewHeaderFooterView.swift I tried: self.delegate = self.parentviewcontroller

but apparently the relationship of TableViewHeaderFooterView and TableView is not child view controller and parent view controller

Lingzt
  • 33
  • 5
  • As the name implies, the header and footer is a *view* not a view controller. Your table view delegate needs to return a UIview or a UIView subclass for the header and footer views as required – Paulw11 Oct 03 '16 at 21:41
  • Here is how you use custom header or footer views in a table view: http://www.ioscreator.com/tutorials/customizing-header-footer-table-view-ios8-swift See more information about tableview in the documentation: https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/TableView_iPhone/TableViewStyles/TableViewCharacteristics.html#//apple_ref/doc/uid/TP40007451-CH3-SW4 – Wiingaard Oct 03 '16 at 21:41

0 Answers0