Skip to content

tableView(_:viewForHeaderInSection:) delegate method cannot be used #81

@shinichy

Description

@shinichy

Describe the bug
tableView(_:viewForHeaderInSection:) delegate method cannot be used when using tableView.didEndScrollingAnimationPublisher.

To Reproduce

class MyViewController: UIViewController {
    @IBOutlet private weak var tableView: UITableView!

    override func viewDidLoad() {
        super.viewDidLoad()
        
        tableView.didEndScrollingAnimationPublisher
            .sink { print("didEndScrollingAnimation") }
    }
}

extension MyViewController: UITableViewDelegate {
    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
        // return my header view
    }
}

MyViewController is configured as a delegate of tableView in a storyboard.

Expected behavior
tableView(_:viewForHeaderInSection:) is called

Device:

  • Device: iPhone 14
  • OS: iOS 16
  • 0.4.1

Additional context
RxCocoa supports this by calling tableView.rx.setDelegate(viewController).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions