Skip to content

Instantly share code, notes, and snippets.

@mataspetrikas
Created March 24, 2017 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mataspetrikas/fc23fe61ef46ad7043767b28bd79b3a2 to your computer and use it in GitHub Desktop.
Save mataspetrikas/fc23fe61ef46ad7043767b28bd79b3a2 to your computer and use it in GitHub Desktop.
enum BooType {
case play
}
protocol FooDelegate {
func onBoo(boo: BooType)
}
class Foo {
var delegate: FooDelegate?
func someFunc() {
delegate?.onBoo(boo: .play)
}
}
// some other file
class Bar: FooDelegate {
func onBoo(boo: BooType) {
switch boo {
case .play {
// is this possible?
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment