Override AppDelegate of Objective-C from swift

Viewed 403

I have a mostly objective-c app (Cordova-based, but that shouldn't matter). And I'm writing a small Swift library.

In this library I need to override a few AppDelegate methods, like applicationDidEnterBackground and applicationWillEnterForeground.

I've tested my swift library in a pure-swift project and I'm simply throwing my code inside the AppDelegate.swift file. Ideally the library is independent and I have some some of AppDelegate+mylibrary.swift that is in charge of getting access to those AppDelegate methods without importing the swift itself into the objective-c AppDelegate.m.

Any thoughts as to how I can accomplish this?

0 Answers
Related