Created
March 30, 2018 18:14
-
-
Save iamcrypticcoder/17155289a8e3deff0ab076b4ea8bbd13 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
class EthernetConnection : Connection { | |
func makeReady() { | |
print("Making Ethernet Ready...") | |
} | |
func isReady() -> Bool { | |
return arc4random_uniform(2) == 0 | |
} | |
func sendPacket(_ data: String) { | |
if data.count > 10 { return } | |
print("Packet sent. [\(data)]") | |
} | |
} | |
class MobileDataConnection: Connection { | |
func makeReady() { | |
print("Making MobileData Ready...") | |
} | |
func isReady() -> Bool { | |
return arc4random_uniform(2) == 0 | |
} | |
func sendPacket(_ data: String) { | |
if data.count > 5 { return } | |
print("Packet sent. [\(data)]") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment