iosbrain / oop-polymorphism-playground Goto Github PK
View Code? Open in Web Editor NEWWith polymorphism, several descendant object/instance references can be assigned to a reference to the parent class, and yet the parent can exhibit the behavior of the descendant. In other words, you can declare a variable of a certain type (parent/UIControl) and it can store references of that type, but it can also store references to any child (subclass) of that type (here, UITextField, UISlider, UISegmentedControl, and UIStepper).
License: MIT License