Skip to content

Instantly share code, notes, and snippets.

@eofster
Last active November 10, 2015 11:29
Show Gist options
  • Save eofster/134d5f79ea6e0efdef8c to your computer and use it in GitHub Desktop.
Save eofster/134d5f79ea6e0efdef8c to your computer and use it in GitHub Desktop.
Pyramid of Doom when accessing first call of an account with identifier
func hangUpFirstCallOnAccountWithIdentifier(identifier: Int) {
if let account = accountRegistry.accountWithIdentifier(identifier) {
if let call = account.firstCall {
call.hangUp()
} else {
print("Could not find first call for an account")
}
} else {
print("Could not find account")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment