Closed richardpap closed 6 years ago
Hi @richardpap,
Quick question, what does your ExampleCardCell
class look like? Does it inherit from CardCell
?
If it doesn't, that should explain why you get the Cast from 'UICollectionViewCell' to unrelated type 'ExampleCardCell' always fails"
message.
I just removed the .nib file and did the whole cell loading programmatically in the example and that seems to work for me so I think it should work. You could try comparing these projects and seeing where yours differs.
You can find the modified (code-only cells) example version here: VerticalCardSwiper.zip
If you're still having issues after that, I'd be happy to help you out further, in that case, please let me know as many details as possible (for example what you're doing differently that could be causing this, error messages, warnings, ...)
Hope this helps.
Kinds regards, Joni
Hmm, i created a brand new project, implemented everything by your example and now it works. So something most be in my project causing this issue.
Thank you for the help!
Kind regards, Richard
Any updates on this? Did you find the problem?
Yep, I managed to fix it last night. I had a class called CardCell as well in my code, which caused the issue. Now everything works perfectly.
Alright, great to hear! 🎉 Closing this issue 🙂
Hey, After following the how to use section, I'm running into an error: "Type 'XYViewController' does not conform to protocol 'VerticalCardSwiperDatasource'" and wants to add the "cardForItemAt" function, however, its implemented as it was described:
This function has a warning btw: "Cast from 'UICollectionViewCell' to unrelated type 'ExampleCardCell' always fails"
The only difference in my code is that i dont use storyboard, so this is how the viewDidLoad looks like:
I'm experience this in xCode 10 and Swift 4.2