Skip to content

Instantly share code, notes, and snippets.

@omayib
Last active December 12, 2016 22:34
Show Gist options
  • Save omayib/04e799a22791f5c285f74e1cbeaf299e to your computer and use it in GitHub Desktop.
Save omayib/04e799a22791f5c285f74e1cbeaf299e to your computer and use it in GitHub Desktop.
subclassing the UIViewController into UILoadingVeiwController
class UILoadingViewController: UIViewController{
func showWaiting(message: String){
print("show waiting from UILoadingViewController with message \(message)")
}
}
class LoginVC : UILoadingViewController{
func buttonTapped(){
showWaiting(message: "show me!")
}
// letter if we have new developer joined, and they try to overrid this function. its fragile!!
override func showWaiting(message: String) {
print("i am dangerous!")
}
}
class AboutVC : UIViewController {
// we cannot see any showWaiting func from here....
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment