I'm adding PushKit notification to my app and have stumbled into the error above.
What I have done:
I extended my AppDelegate with PKPushRegistryDelegate and implemented pushRegistry method:
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, PKPushRegistryDelegate {
func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, forType type: PKPushType) {
}
.
.
.
Everything seems ok but when I build I get the error:
No type or protocol named PKPushRegistryDelegate
I also tried with extension in that case I got a different error:
Cannot find protocol declaration for 'PKPushRegistryDelegate'
I'm guessing that something is missing but cannot find what. Can anyone help me?
p.s. I'm using xcode 9 and swift 4
Imported #import in Bridging-Header.h and now it works.