 
     // MARK: - Helpers
 
-    fileprivate func fittingSize(for view: UIView) -> CGSize {
+    private func fittingSize(for view: UIView) -> CGSize {
         let targetSize = CGSize(
             width: view.frame.width,
             height: UIView.layoutFittingCompressedSize.height


    // MARK: - Fileprivate properties

    fileprivate var tableView: UITableView? {
        return superview as? UITableView
    }

    fileprivate var status: Status {
        return self == tableView?.tableHeaderView ? .header :
            self == tableView?.tableFooterView ? .footer :
            .none

/// This view will autolayout its height, even when used as a tableHeaderView or tableFooterView.
open class SelfSizingTableHeaderFooterView: UITableViewHeaderFooterView {

    private enum Status {
        /// View is set as tableHeaderView
        case header
        /// View is set as tableFooterView
