         
         Utils.registerNibWithCollectionView("ProfileCollectionViewCell", collectionView: collectionView)
         
-//        self.refreshControl = UIRefreshControl()
-//        self.refreshControl.addTarget(self, action: "userTriggeredRefresh", forControlEvents: UIControlEvents.ValueChanged)
-//        self.refreshControl.hidden = true
-//        
-//        self.collectionView.addSubview(refreshControl)
     }
     
     

    
    var headerImageView : UIImageView!
    
    let kHeaderViewHeight : CGFloat = 480
    let kHeaderImageViewHeight : CGFloat = 375
    
    let kStatusBarMagicLine : CGFloat = 100
    let kParalaxImageViewScrollRate : CGFloat = 0.50

    override func viewDidLoad() {
        super.viewDidLoad()

    func scrollViewDidScroll(scrollView: UIScrollView) {
        
        print(scrollView.contentOffset.y)
        checkOffSetForStatusBarBackgroundViewVisability(scrollView.contentOffset.y)
        updateImageViewFrameWithScrollViewDidScroll(scrollView.contentOffset.y)
    }
    
    /**
     Method is called in the scrollViewDidScrgyoll method. This method is the secret sauce to getting the image at the top to lock to the navigation bar or to get the image to stretch.
     
     - parameter scrollViewContentOffset:
     */
    func updateImageViewFrameWithScrollViewDidScroll(scrollViewContentOffset : CGFloat) {
        
        if scrollViewContentOffset >= 0 {
            headerImageView.frame.origin.y = -(scrollViewContentOffset * kParalaxImageViewScrollRate)
        } else {
            headerImageView.frame = CGRectMake(0, 0, view.frame.width, kHeaderImageViewHeight - scrollViewContentOffset)
        }
    }
    
    
    func checkOffSetForStatusBarBackgroundViewVisability(scrollViewContentOffset : CGFloat){
        
        let magicLine = kHeaderImageViewHeight - kHeightOfProfilePictureImageView/2 - UIApplication.sharedApplication().statusBarFrame.size.height
        
        if(scrollViewContentOffset >= magicLine){
            animateInStatusBarBackgroundView(true)
        }
        else{
            animateInStatusBarBackgroundView(false)
        }
   
    }
    

}






