Created
March 19, 2021 14:56
-
-
Save pitt500/a33d39a5f9398c54d746cc52388a2300 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
protocol Loggable { | |
init(filename: String) | |
func log() | |
} | |
class Logger: Loggable { | |
private var filename = "" | |
// Required is needed for subclass conforming protocol too. | |
// Unless class is marked as final | |
required init(filename: String) { | |
self.filename = filename | |
} | |
func log() { | |
print("I'm watching you!") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment