简体   繁体   中英

what is the difference between subview and subclass

Well, the title says it all. What is the difference (if any) between subview and subclass? Is a subview also a subclass? eg when the app launches, the main View is a subview of UIWindow, but UIWindow is a subclass of UIView.

The UIWindow is a subview of UIView becuase the UIWindow is a subclass of UIView. The same concept holds true in other object oriented languages. I can have a super class called Vehicle with subclasses car and motorcycle . The car and the motorcycle are 'subVehicles' of Vehicle...just like UIWindow is a subclass and therefore 'subView' of UIView.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM