Skip to content

Removed preconditions and added guards#6

Open
baubrey91 wants to merge 1 commit intofilletofish:masterfrom
baubrey91:master
Open

Removed preconditions and added guards#6
baubrey91 wants to merge 1 commit intofilletofish:masterfrom
baubrey91:master

Conversation

@baubrey91
Copy link

This will cause the app to not crash

@filletofish
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants