Papr icon indicating copy to clipboard operation
Papr copied to clipboard

HomeViewController crashes in iOS12 and lower when trying to refresh

Open jdisho opened this issue 4 years ago • 0 comments

As @serjooo mentioned:

App crashes still on iOS 12 in the HomeViewController on line 82:

outputs.isRefreshing
.execute { [weak self] isRefreshing in
    if isRefreshing {
        self?.collectionView.scrollToItem(at: IndexPath(item: 0, section: 0), at: .top, animated: false)
        self?.collectionView.setContentOffset(CGPoint(x: 0.0, y: -(self?.refreshControl.frame.height ?? 0.0)), animated: true)
    } else {
        self?.collectionView.setContentOffset(.zero, animated: true)
    }
}
.bind(to: refreshControl.rx.isRefreshing)
.disposed(by: disposeBag)

Commenting out the isRefreshing code solves the problem as the app crashes on scrolling logic.

jdisho avatar Oct 27 '19 15:10 jdisho