Last active
November 10, 2015 11:26
-
-
Save eofster/0e234ae6beec5d60978c to your computer and use it in GitHub Desktop.
Phone call registry returning an optional phone call
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
protocol PhoneCallRegistry { | |
func callWithIdentifier(identifier: Int) -> PhoneCall? | |
} | |
func hangUpCallWithIdentifier(identifier: Int) { | |
if let call = phoneCallRegistry.callWithIdentifier(identifier) { | |
call.hangUp() | |
} else { | |
print("Could not hang up call") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment