You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
shinichy
changed the title
tableView(_:viewForHeaderInSection:) delegate method is not called
tableView(_:viewForHeaderInSection:) delegate method cannot be used
Nov 4, 2022
We had a similar trouble with needing to use indexPathForPreferredFocusedView.
Our solution:
classCollectionView:UICollectionView{// Subclass of `UICollectionView` provides ability to provide a index path for preferred focus closure.// Since we're using `CombineCocoa` we lose the ability to use `UICollectionViewDelegate.indexPathForPreferredFocusedView`varindexPathForPreferredFocused:(()->IndexPath?)?overridevarpreferredFocusEnvironments:[UIFocusEnvironment]{letindexPath=indexPathForPreferredFocused?()letcell= indexPath.map{self.cellForItem(at: $0)}return cell?.map{[$0]}?? super.preferredFocusEnvironments
}}
Describe the bug
tableView(_:viewForHeaderInSection:)
delegate method cannot be used when usingtableView.didEndScrollingAnimationPublisher
.To Reproduce
MyViewController
is configured as a delegate oftableView
in a storyboard.Expected behavior
tableView(_:viewForHeaderInSection:)
is calledDevice:
Additional context
RxCocoa supports this by calling
tableView.rx.setDelegate(viewController)
.The text was updated successfully, but these errors were encountered: