Calling method in current view controller from App Delegate in iOS

后端 未结 4 2142
耶瑟儿~
耶瑟儿~ 2020-12-01 01:23

I have two view controllers (BuildingsViewController and RoomsViewController) that both use a function within the App Delegate called upload. The upload function basically d

4条回答
  •  Happy的楠姐
    2020-12-01 02:10

    Worse comes to worst, you can have both view controllers adhere to a simple one method protocol that will remove that button and refresh the view. Then in your connectionDidFinishLoading method, since you know your view controller must adhere to that protocol, by your design, you simply do something like

    ViewController curView = (Get the current view controller somehow);
    [curview refreshView];
    

提交回复
热议问题