{"action":"created","issue":{"url":"https://api.github.com/repos/jamztang/CSStickyHeaderFlowLayout/issues/59","labels_url":"https://api.github.com/repos/jamztang/CSStickyHeaderFlowLayout/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/jamztang/CSStickyHeaderFlowLayout/issues/59/comments","events_url":"https://api.github.com/repos/jamztang/CSStickyHeaderFlowLayout/issues/59/events","html_url":"https://github.com/jamztang/CSStickyHeaderFlowLayout/issues/59","id":66260988,"number":59,"title":"Setting contentInset causes header image to \"jump\" from bottom to top","user":{"login":"shivateja","id":1393746,"avatar_url":"https://avatars.githubusercontent.com/u/1393746?v=3","gravatar_id":"","url":"https://api.github.com/users/shivateja","html_url":"https://github.com/shivateja","followers_url":"https://api.github.com/users/shivateja/followers","following_url":"https://api.github.com/users/shivateja/following{/other_user}","gists_url":"https://api.github.com/users/shivateja/gists{/gist_id}","starred_url":"https://api.github.com/users/shivateja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shivateja/subscriptions","organizations_url":"https://api.github.com/users/shivateja/orgs","repos_url":"https://api.github.com/users/shivateja/repos","events_url":"https://api.github.com/users/shivateja/events{/privacy}","received_events_url":"https://api.github.com/users/shivateja/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-04T01:32:58Z","updated_at":"2015-06-18T08:11:08Z","closed_at":null,"body":"I'm building an application which has a UITextField outside the collection view. I'm trying to animate setting the bottom inset to cover up the space occupied by the keyboard. Setting contentInset in the animation block causes the header image jump bottom to top sometimes.\r\n\r\nHere's the video demonstrating the problem.\r\nhttp://cl.ly/0w3x1X3f0p0v\r\n\r\nThe following is the code used for setting the insets. The UITextField is independent of the Collection View and has a bottom constraint with the bottom layout guide.\r\n\r\n```swift\r\n    func keyboardWillShow(notification: NSNotification){\r\n        let info: NSDictionary = notification.userInfo!\r\n        let keyboardFrame = (info[UIKeyboardFrameEndUserInfoKey] as NSValue).CGRectValue()\r\n        \r\n        // Take the comment box up\r\n        bottomHeightConstraint.constant = keyboardFrame.height\r\n        self.view.setNeedsUpdateConstraints()\r\n        \r\n        UIView.animateWithDuration(1, delay: 0, options: UIViewAnimationOptions.BeginFromCurrentState, animations: { () -> Void in\r\n            self.view.layoutIfNeeded()\r\n            // Inset from bottom equal to the height of keyboard\r\n            self.collectionView.contentInset = UIEdgeInsetsMake(0, 0, keyboardFrame.height, 0)\r\n            }, completion: nil)\r\n    }\r\n    \r\n    func keyboardWillHide(notification: NSNotification){\r\n        // Bring the comment box down\r\n        bottomHeightConstraint.constant = 0\r\n        self.view.setNeedsUpdateConstraints()\r\n\r\n        UIView.animateWithDuration(1, delay: 0, options: UIViewAnimationOptions.BeginFromCurrentState, animations: { () -> Void in\r\n            self.view.layoutIfNeeded()\r\n            self.collectionView.contentInset = UIEdgeInsetsZero\r\n            }, completion: nil)\r\n    }\r\n```\r\n\r\nI'm not aware of UICollectionView internals and the layouts but I'm guessing the problem is in the layout's header rendering code. Is there any solution/better way to solve this? Thanks in advance!"},"comment":{"url":"https://api.github.com/repos/jamztang/CSStickyHeaderFlowLayout/issues/comments/113069404","html_url":"https://github.com/jamztang/CSStickyHeaderFlowLayout/issues/59#issuecomment-113069404","issue_url":"https://api.github.com/repos/jamztang/CSStickyHeaderFlowLayout/issues/59","id":113069404,"user":{"login":"brunobasas","id":7486263,"avatar_url":"https://avatars.githubusercontent.com/u/7486263?v=3","gravatar_id":"","url":"https://api.github.com/users/brunobasas","html_url":"https://github.com/brunobasas","followers_url":"https://api.github.com/users/brunobasas/followers","following_url":"https://api.github.com/users/brunobasas/following{/other_user}","gists_url":"https://api.github.com/users/brunobasas/gists{/gist_id}","starred_url":"https://api.github.com/users/brunobasas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brunobasas/subscriptions","organizations_url":"https://api.github.com/users/brunobasas/orgs","repos_url":"https://api.github.com/users/brunobasas/repos","events_url":"https://api.github.com/users/brunobasas/events{/privacy}","received_events_url":"https://api.github.com/users/brunobasas/received_events","type":"User","site_admin":false},"created_at":"2015-06-18T08:11:08Z","updated_at":"2015-06-18T08:11:08Z","body":"Same problem here"}}