Last active
February 12, 2017 15:42
-
-
Save wh1pch81n/0308d740af16ae0e73e5716778fb0771 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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