Skip to content

Instantly share code, notes, and snippets.

@pitt500
Created March 19, 2021 14:56
Show Gist options
  • Save pitt500/a33d39a5f9398c54d746cc52388a2300 to your computer and use it in GitHub Desktop.
Save pitt500/a33d39a5f9398c54d746cc52388a2300 to your computer and use it in GitHub Desktop.
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