简体   繁体   中英

Is it possible to switch a view without a button?

I got only so far to be able to switch a view by pressing a button or with a timer. But I don't get it to switch a view by events like didReceiveLocalNotification. Is it impossible to do this?

Yes, that's possible , Because usually we specify the method with notification in which we wish to receive it.

Put the same code from your UIButton action: to notification method.

Yes, all you have to do is doing the switch inside the method didReceiveLocalNotification. You will need to send a message to the view controller you want to perform the switch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM