My code was fine before, but it tips me :
cannot find protocol declaration for 'CAAnimationDelegate';did you mean 'UIApplicationDelegate'?
when I run it today.
I have tried import QuartzCore/CAAnimation.h
but doesn't work.
CAAnimationDelegate is a new protocol that was added in the iOS 10 SDK. That means it is there if you build with Xcode 8, but not there if you build with Xcode 7.
When you build with Xcode 8, you'll get a warning to say:
Assigning to 'id<CAAnimationDelegate> _Nullable' from incompatible type 'WhateverUIViewController *const __strong'
If you add the CAAnimationDelegate, your code won't build in Xcode 7 anymore. If you need to build with both Xcode's, you need to use ifdefs:
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 100000
// CAAnimationDelegate is not available before iOS 10 SDK
@interface WhateverUIViewController ()
#else
@interface WhateverUIViewController () <CAAnimationDelegate>
#endif
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With