JoniVR / VerticalCardSwiper

A marriage between the Shazam Discover UI and Tinder, built with UICollectionView in Swift.
MIT License
1.4k stars 101 forks source link

Unexpectedly found nil while unwrapping an Optional Value #8

Closed lurein closed 6 years ago

lurein commented 6 years ago

After following the steps outlined in the readme, I get the following error in viewDidLoad on the line: cardSwiper.datasource = self

Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value causing the app to crash on startup.

JoniVR commented 6 years ago

Hi @lurein

After testing with a new project, it seems like you're right, I'm getting the same problem.

I'll look into it and try to release a fixed version today.

Thank you for letting me know.

JoniVR commented 6 years ago

@lurein If you want a workaround right now and don't mind using storyboard, try adding the VerticalCardSwiper class to the view of the controller (or take a look at the example), that approach still seems to work.

schermafbeelding 2018-06-29 om 13 54 19

JoniVR commented 6 years ago

Forgot to reference this issue, but it should be fixed in b4642a0 by changing up the example code and using the init(frame: CGRect) function instead. I think something just went wrong with casting the view.

I'll release it in a moment so you can use this method.

Closing this issue, feel free to reopen if you still come across it.

edit: version 0.1.0-beta3 is released, which should fix the issue (better method in README)