Coder Social home page Coder Social logo

Comments (5)

DenTelezhkin avatar DenTelezhkin commented on July 17, 2024 1

@skydivedan No worries, take your time, it can wait till Monday =)

As for tableView.shouldIndentWhileEditingRowAt - it's different because UITableViewCell does not actually call delegate method if you ask it's property shouldIndentWhileEditing, and 4 steps logic I described earlier should work fine.

from dttableviewmanager.

DenTelezhkin avatar DenTelezhkin commented on July 17, 2024

Hey!

I believe this might be a bug in DTCollectionViewManager. From documentation on UICollectionViewDelegate collectionView(_:canFocusItemAt:):

You can use this method, or a cell’s canBecomeFocused method, to control which items in the collection view can receive focus. The focus engine calls the cell’s canBecomeFocused method first, the default implementation of which defers to the collection view and this delegate method.

Which is unfortunate, because this event implementation in DTCollectionViewManager is implemented like so:
https://github.com/DenHeadless/DTCollectionViewManager/blob/master/Source/DTCollectionViewDelegate.swift#L181

And so what I was trying to do is

  1. Call closure event, if it's registered
  2. Call real UICollectionViewDelegate method, if it's implemented
  3. Call cell's canBecomeFocused.
  4. Return true if all other steps fail as a sensible default.

What seems to be happening is step 3 implicitly calls step 2 in UICollectionView implementation which leads to infinite recursion.

I don't have experience of working with this API, but it seems like removing step 3 in DTCollectionViewDelegate implementation looks like the way to go. What do you think?

from dttableviewmanager.

skydivedan avatar skydivedan commented on July 17, 2024

Yes, your assessment looks correct. Additionally, you'll have to take out the same clause in DTTableViewDelegate.canFocusRowAt. I'm going to run some tests here, and see what develops.

from dttableviewmanager.

skydivedan avatar skydivedan commented on July 17, 2024

Quick note... sorry to say but I can't get back to this until Monday, unfortunately. But I dug around a bit more in the code and found a similar example of this DTTableViewDelegate in tableView.shouldIndentWhileEditingRowAt.

from dttableviewmanager.

DenTelezhkin avatar DenTelezhkin commented on July 17, 2024

This bug is fixed in DTCollectionViewManager 6.4.1 release. Closing.

from dttableviewmanager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.