Git Product home page Git Product logo

infinitelayout's People

Contributors

arnauddorgans avatar cdann-leafly avatar dlbuckley avatar lm2343635 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

infinitelayout's Issues

Different cell returned based on centered indexPath return on infiniteCollectionView(_ infiniteCollectionView: InfiniteCollectionView, didChangeCenteredIndexPath centeredIndexPath: IndexPath?

i want to edit the cell contents once they are scroll to the center but when I dequeue cell from the given centeredIndexPath from delegate func

func infiniteCollectionView(_ infiniteCollectionView: InfiniteCollectionView, didChangeCenteredIndexPath centeredIndexPath: IndexPath?)

i will get the wrong cell.

How can I get the correct centered cell from the given centeredIndexPath in the delegate?
Thanks

UICollectionViewDataSourcePrefetching seems to be broken

func collectionView(_ collectionView: UICollectionView, prefetchItemsAt indexPaths: [IndexPath]) and
func collectionView(_ collectionView: UICollectionView, cancelPrefetchingForItemsAt indexPaths: [IndexPath]) are called repeatedly with the same values, making it almost entirely useless.

Has anyone encountered this? Or am I using this library incorrectly?

Unable to import Rx bindings through Swift Package Manager

The InfiniteLayout Rx bindings, which are in a separate sub-spec for Cocoapods, were left out entirely of the SPM package definition.

This makes it not possible to use InfiniteLayout with Rx bindings when trying to manage dependencies with SPM.

I've updated the package manifest to define a separate library for the Rx bindings, which can optionally be included as a dependency. This should leave the existing package (defined without Rx bindings) unaffected and mirrors the setup for Cocoapods with 2 different libraries.

I've opened a pull request with these changes here: #16

Please have a look when you are able, and please let me know if there are any issues or changes you would require before merging.

Thanks!
-Chris

Alignment left

Hi,
How I can alignment left collectionViewCell in your layout?

Obj-c call method

Hi, I am gettin wrong indexPath, while inserting item to array and reloading collection view. How to call this method from obj-c?

func section(from infiniteSection: Int) -> Int

Infinitely looping collection view

Hello!

First of all wanted to thank you for such an amazing library! :)

I am trying to implement infinitely scrolling collection view with timer, so that it periodically slides to next indexPath.

Currently what I am doing is, I have function that looks like this, and I just call it every like 5 seconds.

func scrollToNextPage() {
     guard let currentPage = collectionView.centeredIndexPath?.row else { return }
     collectionView.scrollToItem(at: IndexPath(item: currentPage + 1, section: 0), at: .centeredHorizontally, animated: true)

But after some time, it throws an error:

'NSInvalidArgumentException', reason: 'attempt to scroll to invalid index path: <NSIndexPath: 0x282bb0980> {length = 2, path = 0 - 162}'

I have also trying to doing like this instead:

collectionView.scrollToItem(at: collectionView.indexPath(from: IndexPath(item: currentPage + 1, section: 0)), at: .centeredHorizontally, animated: true)

But the problem with this one is that when it gets to the last (supposedly last in the raw data source) item, when it scrolls to the first one it does it with animation of scrolling all the items back to the first one, but desired behavior is that it scrolls from the last item to the first with like "swiping right" animation, just ordinary scrolling to next item.

BR

NSLayoutConstraintNumberExceedsLimit

InfiniteLayout_Example[89608:25311340]
This NSLayoutConstraint is being configured with a constant that exceeds internal limits. A smaller value will be substituted, but this problem should be fixed. Break on BOOL _NSLayoutConstraintNumberExceedsLimit(void) to debug. This will be logged only once. This may break in the future.

I found this problem when running example of custom layout

InfiniteCollectionViewDelegate is not working

Hi! Thanks for the great library.
It works very well and easy to use. However it seems that the InfiniteCollectionViewDelegate isn't working. In the exemple the picker view never displayes the selected item. Also adding a InfiniteCollectionViewDelegate to the BaseCollectionViewController doesn't work too...

In the file InfiniteCollectionView.swift the current function seems to have an issue:

func updateLayoutIfNeeded() {
        self.loopCollectionViewIfNeeded()
        self.centerCollectionViewIfNeeded()
        
        let preferredVisibleIndexPath = infiniteLayout.preferredVisibleLayoutAttributes()?.indexPath
        if self.centeredIndexPath != preferredVisibleIndexPath {
            let previousCenteredIndexPath = self.centeredIndexPath
            self.centeredIndexPath = preferredVisibleIndexPath
            self.infiniteDelegate?.infiniteCollectionView?(self, didChangeCenteredIndexPath: previousCenteredIndexPath, to: self.centeredIndexPath)
        }
}

Where let preferredVisibleIndexPath = infiniteLayout.preferredVisibleLayoutAttributes()?.indexPath is always nil. Hence the line that use the delegate is never reached.

Do you have any insight regarding this issue @arnauddorgans ?

Scroll to not visible cell?

Hello,

I would like to scroll to a not visible cell. Is it possible to perform it with the framework?

Thanks

scrollToItem with animation will behave unexpectedly.

Thank for good work.

I found InfiniteCollectionView's inexplicable movements when it do scrollToItem with animation.

@IBAction func didTapScrollToOneButton(_ sender: Any) {
    self.collectionView?.scrollToItem(at: IndexPath(item: 0, section: 0), at: .centeredHorizontally, animated: true)
}

GIF
scroll

Probably, I think scrollToItem's argument indexpath is not be optimized for InfiniteCollectionView.

I am glad if you can check it.

Memory Leak due to strong reference to InfiniteCollectionViewDelegate

Hey!
Thank you for your nice infinite layout implementation. I found a possible memory leak in your code. The line:
@IBOutlet open var infiniteDelegate: InfiniteCollectionViewDelegate?
should actually read:
@IBOutlet weak open var infiniteDelegate: InfiniteCollectionViewDelegate?

Otherwise you will have a strong retain cycle if the view controller presenting the collection view is also the delegate of the collection view.

I don't think that this issue is also the case for your overrides of the standard UICollectionView's delegate and data source, because they are defined as weak references by Apple and you don't override this weak with your overrides. BUT: For convenience reasons I would also recommend you to also add weak to those properties (so that everyone knows ;) ).
Apart from that: Keep it up!

Best Regards!

Not Called UICollectionViewDelegate and UICollectionViewDelegateFlowLayout

Hi. Thanks for making a good library.

The methods in UICollectionViewDelegate and UICollectionViewDelegateFlowLayout have not been called since pod update.

installed InfiniteLayout from an empty project, it will be called properly. But not called in my project.

When using InfiniteLayout / Rx, the app dies in setupRx(setDelegate).

스크린샷 2019-03-28 오후 5 39 33

Why isn't it called only in my project??????? I need your help....

Failed Combining with CollectionPickerView

I've tried combining InfiniteCollectionView with CollectionPickerView but I'm getting an exception here:

Thread 1: EXC_BAD_ACCESS (code=2, address=0x16f56bfd0)

on line 27: InfiniteCollectionViewProxy.swift

image

my code for combining is:

image

and my custom layout:

image

I'm kind of new in iOS development so please can You help me with that?

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.