Overriding the Delegate Property of UIScrollView Like UICollectionView Does

has a delegate property typed as : overrides this property, but uses instead: However, when you try to override the delegate with a custom protocol in the same way: You get a compiler error: So how can a custom subclass override the delegate property? The answer is . Supplementary note: The Objective-C approach to overriding works as follows: 1. Assign to . 2. Set the superclass's delegate to the subclass itself. When a delegate method is called, the runtime looks for a method signature via . If the subclass doesn't implement it, it checks whether does. The signature is returned to the system, which wraps it into an and passes it to . If implements the delegate method, it will be called. When calling the superclass's delegate methods, is called first to check whether the given is implemented. If it is, the runtime proceeds to and . Note: also conforms to , which I believe is to suppress the warning in . However, this means will always return a non-nil object. In that case, you can simply check in whether to forward the call. You could remove the conformance and change the assignment to — testing confirms this works fine as well, and the flow becomes easier to understand.