【发布时间】:2015-06-16 09:45:17
【问题描述】:
我正在为我的应用开发共享扩展程序。
我知道如果用户最小化并重新打开应用程序,将触发以下方法。
- (void)applicationDidEnterBackground:(UIApplication *)application
- (void)applicationWillEnterForeground:(UIApplication *)application
当用户最小化共享扩展时,我需要同样的东西。上述方法不会在共享扩展中被触发。
我使用UIViewController 作为我的共享扩展的超类。尝试了以下方法。
- (void)viewDidAppear:(BOOL)animated
- (void)viewDidDisappear:(BOOL)animated
-viewDidDisappear 不会在用户最小化应用程序时被调用。
是否可以知道用户是否最小化共享扩展?
我需要您的宝贵建议。
提前致谢
【问题讨论】:
-
您是否将 SLComposeServiceViewController 用于共享扩展控制器类。它是一个普通的视图控制器,你能使用 viewDidAppear 和 viewDidDisappear 吗?
-
@GeneratorOfOne。更新了我的问题。
-
你试过监听
UIApplicationDidEnterBackgroundNotification等吗?
标签: ios ios-app-extension ios8-share-extension