                 }
             )
         }
-        
     }
 
     func startSearchReposition(searchBar: UISearchBar, animated: Bool) {

        let spacing = Utils.DeckViewLayout.DecksSpacing
        equalSizeAndSpacing(numberOfCellsInRow: Utils.DeckViewLayout.DecksInRowIPhoneVer, spacing: spacing, collectionFlowLayout: flow)

        decksCollectionView.backgroundColor = UIColor.whiteColor()
        
        let swipeGestureRecognizer = UISwipeGestureRecognizer(target: self, action: #selector(DecksViewController.hideKeyboard))
        swipeGestureRecognizer.direction = [.Down,.Up]
        decksCollectionView.addGestureRecognizer(swipeGestureRecognizer)
        swipeGestureRecognizer.delegate = self
        
    }
    
    override func observeValueForKeyPath(keyPath: String?, ofObject object: AnyObject?, change: [String : AnyObject]?, context: UnsafeMutablePointer<Void>) {
        if keyPath == "openSide",let newSide = change?["new"] as? Int, let oldSide = change?["old"] as? Int where newSide != oldSide {
            
            if newSide != 0 {
                hideSearchBar(navbarHeight)

            }else {
                hideSearchBar(-topItemOffset)
            }

        }
    }
    
    // this function calculate size of decks, by given spacing and number of cells in row

            testViewController.testLogicSource = testLogic
        }
    }
}

// MARK: UISearchBar implementaton
extension DecksViewController: UISearchBarDelegate {

    func setupSearchBar() {
        let bar = UISearchBar(frame: CGRect(x: 0, y: 0, width: view.frame.width, height: searchBarHeight))
        bar.searchBarStyle = .Default
        bar.tintColor = UIColor.whiteColor()
