InfiniteCarousel icon indicating copy to clipboard operation
InfiniteCarousel copied to clipboard

Removed preconditions and added guards

Open baubrey91 opened this issue 4 years ago • 1 comments

This will cause the app to not crash

baubrey91 avatar Jun 04 '20 19:06 baubrey91

Hi Brandon, Thank you for your PR.

Did the app crash for you? Was it the incorrect behaviour inside the library or the code, which was calling the library?

The reason why I used precondition check is for falling faster in case of a bug. Also to replicate the behaviour in UIKit – if I resemble correctly, passing incorrect indexPath to for example this method will throw an exception. Probably, a better approach would be to throw an exception here, rather than just fail on precondition.

filletofish avatar Jun 14 '20 20:06 filletofish