Created
November 10, 2015 12:20
-
-
Save eofster/f0fd24cb9ba00d03e7a7 to your computer and use it in GitHub Desktop.
Guard statements when accessing first call of an account with identifier
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
func hangUpFirstCallOnAccountWithIdentifier(identifier: Int) { | |
guard let account = accountRegistry.accountWithIdentifier(identifier) else { | |
print("Could not find account") | |
return | |
} | |
guard let call = account.firstCall else { | |
print("Could not find first call for an account") | |
return | |
} | |
call.hangUp() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment