Last active
December 12, 2016 22:34
-
-
Save omayib/04e799a22791f5c285f74e1cbeaf299e to your computer and use it in GitHub Desktop.
subclassing the UIViewController into UILoadingVeiwController
This file contains 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 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