DeckTransition icon indicating copy to clipboard operation
DeckTransition copied to clipboard

UITableView Not working properly.

Open vatsal1992 opened this issue 6 years ago • 4 comments

Hey Harshil,

A Big Thanks for this Library

i've implemented this library and i'm trying to show list on the presented ViewController and for that i've implemented UITableView with all required delegates & datasources.

Issue I found that there is a strange problem while i scroll the tableView. UITableViewCell doesn't reuses properly. while scrolling, it randomly hides UITableViewCell.

i've checked it twice that this is not the improper implementation of UITableView.

vatsal1992 avatar Feb 27 '18 06:02 vatsal1992

I'm having the same issue, here is a video illustrating the bug:

ezgif-3-2c12a33b59

It seems to happen when you scroll up rapidly and it bounces at the top. It seems to be because of these lines: https://github.com/HarshilShah/DeckTransition/blob/master/Source/ScrollViewUpdater.swift#L85-L87 If I comment them the issue is gone.

Here is the code I used to reproduce the issue:

class TableViewController: UITableViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell")
    }
    
    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 40
    }
    
    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
        cell.textLabel?.text = "IndexPath is \(indexPath)"
        return cell
    }
}

And change https://github.com/HarshilShah/DeckTransition/blob/master/Example/Source/ModalViewController.swift#L47 to let modal = TableViewController()

felix-dumit avatar Feb 27 '18 22:02 felix-dumit

Thank you for filing a bug and for the detailed reproduction. I'm gonna need to look into this a bit more, but the repro steps help a lot!

HarshilShah avatar Feb 28 '18 10:02 HarshilShah

Are you working on ?

TheAbstractDev avatar Apr 05 '18 15:04 TheAbstractDev

It’s on my list but I haven’t had much time unfortunately. Happy to look at others’ solutions if anyone has taken a shot. The fixit above to comment some lines breaks the bounce back behaviour so it can’t be used.

HarshilShah avatar Apr 05 '18 15:04 HarshilShah