MaherKSantina / MSPeekCollectionViewDelegateImplementation

A custom paging behavior that peeks the previous and next items in a collection view
https://medium.com/@maher.santina90/how-to-create-cells-that-peek-on-the-sides-like-ios-11-app-store-ef4bb54c0c7d
MIT License
356 stars 32 forks source link

Selection not working. #36

Closed thejeraldo closed 5 years ago

thejeraldo commented 5 years ago

@objc optional func peekImplementation(_ peekImplementation: MSPeekCollectionViewDelegateImplementation, didSelectItemAt indexPath: IndexPath) doesn't work and not even appears on the autocomplete in Xcode.

Checking MSPeekCollectionViewDelegateImplementation from the Pod project it seems it is not in the MSPeekImplementationDelegate. Only the following is shown:

public protocol MSPeekImplementationDelegate: AnyObject {
    func peekImplementation(_ peekImplementation: MSPeekCollectionViewDelegateImplementation, didChangeActiveIndexTo activeIndex: Int)
}

func peekImplementation(_ peekImplementation: MSPeekCollectionViewDelegateImplementation, didChangeActiveIndexTo activeIndex: Int) seems to be working fine.

And my current implementation is as below:

let peekImplementation = MSPeekCollectionViewDelegateImplementation(cellSpacing: 16.0, cellPeekWidth: 16.0)

collectionView?.dataSource = self
collectionView?.configureForPeekingDelegate()
collectionView?.delegate = peekImplementation
peekImplementation.delegate = self

Am I missing something?

MaherKSantina commented 5 years ago

Thanks @thejeraldo for raising this issue. Are you sure that you are using the latest version of this pod? This function was introduced in version 1.1.0. Waiting for your reply

thejeraldo commented 5 years ago

Yes I am. I believe it was not included in 1.1.0 as it is there in 1.0.0 after checking both tags.

thejeraldo commented 5 years ago

Sorry. It is there in 1.1.0, I just installed MSPeekCollectionViewDelegateImplementation this week. Not sure why it wasn't on 1.1.0 and had to specify the tag on the Podfile.

Thanks by the way for this amazing library. Cheers!

MaherKSantina commented 5 years ago

Ohh maybe the pods on your machine are not up to date with the Cocoapods repo because the 1.1.0 version was not long ago.

Haha no worries mate I'm glad your issue is fixed. Let me know if you experience any problems 👍