如何在点击按钮时刷新应用

时间:2018-11-27 09:35:38

标签: ios

在此按钮动作中,我需要转到appdelegate。怎么走。

我在视图控制器中有一个按钮。

@IBAction func refreshButton(_ sender: AnyObject) {
}

在我的应用程序委托中

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

    // Override point for customization after application launch.

    let PAGE1model:NH_HomeModel = HomeModel(nameText: "", contactnoText: "", emailidText: "")!
    let questionlistdataSourceModel:QuestionDataSourceModel = QuestionDataSourceModel(array: nil)
    let questionlistviewModel:QuestionViewModel = QuestionViewModel(withdatasource: questionlistdataSourceModel, withmodel: PAGE1model)

    let dummyDataSource:DummyDataSourceModel = DummyDataSourceModel(array: nil)
    let dummyDataViewModel:DummyDataViewModel = DummyDataViewModel(withdatasource: dummyDataSource, withmodel: PAGE1model)

    let questionlistviewController:QuestionViewController = NH_QuestionViewController(nibName: "QuestionViewController", bundle: nil, withViewModel: questionlistviewModel, withDummyDataViewModel: dummyDataViewModel)
    navController = UINavigationController()

    self.navController!.pushViewController(questionlistviewController, animated: false)

    self.window = UIWindow(frame: UIScreen.main.bounds)
    self.window!.rootViewController = navController
    self.window!.backgroundColor = UIColor.white
    self.window!.makeKeyAndVisible()

    return true
}

在按钮上单击我需要刷新应用程序。它应该转到应用程序委托。如何实现它?如何在刷新按钮中执行操作。在刷新按钮上单击我需要转到应用程序委托。< / p>

0 个答案:

没有答案