 extension ForecastView: UICollectionViewDelegateFlowLayout {
     
     public func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
-        toggleLayout()
+        state.toggle()
     }
     
 }

    
    private var collectionView: UICollectionView!
    private let layout = UICollectionViewFlowLayout()
    private var state: ForecastViewState = .Collapsed
    private var items = [Forecast]() {
        didSet {
            NSOperationQueue.mainQueue().addOperationWithBlock {

    private enum ForecastViewState {
        case Collapsed
        case Expanded
        
        mutating func toggle() {
            if self == .Collapsed {
                self = .Expanded
            } else {
                self = .Collapsed
            }
        }
    }
        
    private func numberOfDays() -> Int {
