2 // FilterSectionHeaderCollectionReusableView.swift
5 // Created by Pawel Dabrowski on 12/06/2018.
6 // Copyright © 2018 Fundacja Nowoczesna Polska. All rights reserved.
11 protocol FilterSectionHeaderCollectionReusableViewDelegate: class {
12 func filterSectionRefreshButtonTapped(section: FilterSection)
15 class FilterSectionHeaderCollectionReusableView: UICollectionReusableView {
16 var delegate: FilterSectionHeaderCollectionReusableViewDelegate?
18 @IBOutlet weak var titleLabel: UILabel!
19 @IBOutlet weak var refreshButton: ActivityIndicatorButton!
20 var filterSection : FilterSection!
22 func setup(filterSection: FilterSection, isDownloading: Bool){
23 self.filterSection = filterSection
24 titleLabel.text = filterSection.title
25 refreshButton.setIndicatorButtonState(state: isDownloading ? .loading : .button)
28 @IBAction func refreshButtonAction(_ sender: Any) {
29 delegate?.filterSectionRefreshButtonTapped(section: filterSection)