         }
     }
     func scrollViewDidScroll(scrollView: UIScrollView) {
-        if (scrollView.contentOffset.y < topItemOffset) {
-            showSearchBar()
-            
-        }else {
-            hideSearchBar(-topItemOffset)
-        }
+        
+        if (!isSearching) {
+            if (scrollView.contentOffset.y < topItemOffset) {
+                showSearchBar()
+                
+            }else {
+                hideSearchBar(-topItemOffset)
+            }
+        }
+        
+    }
+    
+    func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWithGestureRecognizer otherGestureRecognizer: UIGestureRecognizer) -> Bool {
+        return true 
     }
 }
 

    private var searchBar: UISearchBar?

    var isSearchBarVisible = false

    lazy private var statusBarHeight: CGFloat = {
        return UIApplication.sharedApplication().statusBarFrame.height

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

        decksCollectionView.backgroundColor = UIColor.whiteColor()
        
        let swipeGestureRecognizer = UISwipeGestureRecognizer(target: self, action: Selector("hideKeyboard"))
        swipeGestureRecognizer.direction = [.Down,.Up]
        decksCollectionView.addGestureRecognizer(swipeGestureRecognizer)
        swipeGestureRecognizer.delegate = self
        
    }
    
