         case all
     }
 }
+

    // TableView returns wrong content size when takes table header and footer views.
    var contentSize: CGSize {
        if let tableView = self.scrollView as? UITableView {
           let rowsCount = tableView.dataSource?.tableView(tableView, numberOfRowsInSection: 0) ?? 0
            if let footerView = tableView.tableFooterView , rowsCount == 0 {
                return CGSize(width: tableView.contentSize.width, height: footerView.frame.origin.y)
            }
            if let footerView = tableView.tableFooterView, let headerView = tableView.tableHeaderView, rowsCount == 0 {
                return CGSize(width: tableView.contentSize.width, height: footerView.bounds.height + headerView.bounds.height)
            }
        
        }
        return self.scrollView?.contentSize ?? UIScreen.main.bounds.size
    }


import UIKit

public protocol ContentControl {
    func startAnimating()
    func stopAnimating()
    var isAnimating: Bool { get }
}

open extension CGRect {
    var center: CGPoint {
        return CGPoint(x: self.origin.x + self.width / 2, y: self.origin.y + self.height / 2)
    }
}

open class UIInfiniteControl: UIControl {
    var height: CGFloat = 60
    var activityIndicatorView: UIActivityIndicatorView!
    
