Google News
logo
Swift - Interview Questions
Highlight the key difference between Upcast and Downcast in ios Swift.
The key difference between Upcast and Downcast in ios Swift is that upcasting from a derived to a base class can be verified at compile-time and will never fail to compile and Downcasts, on the other hand, can fail to compile since the precise class is not always known. It is possible that the UIView you have is a UITableView or a UIButton.
Advertisement