Workaround for automaticallyAdjustsScrollViewInsets bug on iOS 9.0.x

This commit is contained in:
Diego Sanchez 2016-01-23 22:35:42 +00:00
parent 2f1755b25e
commit cad19d0c2e
1 changed files with 8 additions and 0 deletions

View File

@ -173,6 +173,14 @@ public class ChatViewController: UIViewController, UICollectionViewDataSource, U
} else if !isInteracting || inputIsAtBottom {
self.collectionView.contentOffset.y = newContentOffsetY
}
self.workaroundContentInsetBugiOS_9_0_x()
}
func workaroundContentInsetBugiOS_9_0_x() {
// Fix for http://www.openradar.me/22106545
self.collectionView.contentInset.top = self.topLayoutGuide.length + self.constants.defaultContentinsets.top
self.collectionView.scrollIndicatorInsets.top = self.topLayoutGuide.length + self.constants.defaultScrollIndicatorInsets.top
}
func rectAtIndexPath(indexPath: NSIndexPath?) -> CGRect? {