Intermediate Swift
Q55 / 100

What is the @objc attribute used for?

Correct! Well done.

Incorrect.

The correct answer is B) Exposes Swift declarations to Objective-C runtime, enabling use with Objective-C APIs, selectors, and dynamic dispatch

B

Correct Answer

Exposes Swift declarations to Objective-C runtime, enabling use with Objective-C APIs, selectors, and dynamic dispatch

Explanation

@objc func handleTap(_ sender: UIButton) makes the method callable as a selector. Required for target-action, KVO, and Objective-C delegation.

Progress
55/100