Created
November 22, 2016 12:55
-
-
Save ncreated/f124a1770901abea98e6ecc0f97afb0f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Crash: | |
let cell = tableView.dequeueReusableCell(withIdentifier: Constants.twoLabelsCellIdentifier) as! TwoLabelsIconCell | |
// Crash with verbose message: | |
guard let cell = tableView.dequeueReusableCell(withIdentifier: Constants.twoLabelsCellIdentifier) as? TwoLabelsIconCell else { | |
fatalEror("Cannot dequeue `TwoLabelsIconCell`") | |
} | |
// Crash in DEBUG, recover in Release: | |
guard let cell = tableView.dequeueReusableCell(withIdentifier: Constants.twoLabelsCellIdentifier) as? TwoLabelsIconCell else { | |
assertionFailure("Cannot dequeue `TwoLabelsIconCell`") | |
return TwoLabelsIconCell() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment