static var mainWindow: UIWindow {
get {
let app = UIApplication.shared.delegate as! AppDelegate;
if app.window != nil {
app.window!.backgroundColor = .white;
app.window!.makeKeyAndVisible();
return app.window!;
}
app.window = UIWindow.init(frame: UIScreen.main.bounds);
app.window?.backgroundColor = .white;
app.window?.makeKeyAndVisible();
return app.window!;
}
set {
let app = UIApplication.shared.delegate as! AppDelegate;
app.window = newValue;
}
}
drag it into the actual production of the project, encapsulate and report an error
- ERROR | [iOS] xcodebuild: / Users/shang/Documents/GitHub/SwiftExpand/SwiftExpand/UIApplication+Helper.swift:77:57: error: use of undeclared type "AppDelegate"