Skip to content

Instantly share code, notes, and snippets.

@wh1pch81n
Last active February 12, 2017 15:42
Show Gist options
  • Save wh1pch81n/0308d740af16ae0e73e5716778fb0771 to your computer and use it in GitHub Desktop.
Save wh1pch81n/0308d740af16ae0e73e5716778fb0771 to your computer and use it in GitHub Desktop.
class ViewController: UIViewController {
var customizerObject: SpecialProtocol?
override func viewDidLoad() {
super.viewDidLoad()
specialMethod()
}
func specialMethod() {
// default
if let c = customizerObject {
c.specialMethod()
return
}
}
}
protocol SpecialProtocol: class {
func specialMethod()
}
class VCCustomizer: NSObject, SpecialProtocol {
func specialMethod() {
// Special implementation
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment