I have integrated the Localtyics iOS SDK. After this I am getting the error like below: Could not cast value of type 'LLAppDelegateProxy'
It means I am unable to get a reference of the App delegate object. I am in trouble now because I want Localytics & want a reference object of App delegate as well.
Does any body know a solution of this?
Localytics replaces your AppDelegate behind-the-scenes with their proxy class
(LLAppDelegateProxy
). Localytics suggests creating a static reference to your original AppDelegate for access like so:
class AppDelegate: UIResponder, UIApplicationDelegate {
static var originalAppDelegate: AppDelegate!
// ...
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
AppDelegate.originalAppDelegate = self
// ...
}
Access using:
AppDelegate.originalAppDelegate.someMethod()
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