I am getting an error, While accessing MDM using AppConnect SDK in swift 1.2.
Error :
[AppConnect:Error] AppConnect is unable to start because [UIApplication sharedApplication] is not an instance of AppConnectUIApplication.
Code Snippet :
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, AppConnectDelegate {
var window: UIWindow?
var appct : AppConnect!;
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
// Initialize the AppConnect library
AppConnect.initWithDelegate(self)
self.appct = AppConnect.sharedInstance()
self.appct.startWithLaunchOptions(launchOptions)
return true
}
}
Application is crashing at self.appct = AppConnect.sharedInstance()
Comment out
@UIApplicationMainand change your main.swift file to the following:For more information, follow the setup instructions in the Documentation folder of the SDK source. (You have to make sure you follow the instructions of the document that matches the SDK that you are using since MI changes things frequently.)