Key value observing kvo
shape
@objc
attribute in Swift is used to expose Swift code (such as methods, properties, or classes) to the Objective-C runtime. This allows Swift code to be used with Objective-C features, such as dynamic dispatch, selectors, KVO (Key-Value Observing), and targets for actions. The @objc
attribute is essential for interoperability between Swift and Objective-C, especially when working with APIs that require Objective-C runtime features. UIViewController
lifecycle refers to the sequence of methods that are called as a UIViewController
object goes through different stages in its existence. These stages include creation, presentation, interaction, and destruction. Understanding the lifecycle helps developers manage view-related tasks, such as data loading, view configuration, and cleanup.