Contenu connexe
Similaire à AppSwitcherでアプリをユーザーファーストに (20)
Plus de Hiramatsu Ryosuke (11)
AppSwitcherでアプリをユーザーファーストに
- 9. ○その1 - バックグラウンドで生き続ける必要があるアプリ
<アプリが終了したタイミングでLocal通知>
- (void)applicationWillTerminate:(UIApplication *)application
{
UILocalNotification *notification = [[UILocalNotification alloc] init];
if (notification)
{
notification.timeZone = [NSTimeZone defaultTimeZone];
notification.repeatInterval = 0;
notification.alertBody = @"アプリを終了するとログがとれなくなります。再起動しますか?";
notification.alertAction = @"再起動する";
}
}
[[UIApplication sharedApplication] scheduleLocalNotification:notification];
※willTerminateが呼ばれるには
バックグラウンド実行中である必要があります。
- 12. ○その2 - 途中で切られたタスクが完了できないアプリ
- (UIView *)coverView {
if (_coverView == nil) {
UIStoryboard *board = self.window.rootViewController.storyboard;
UIViewController *vc = [board
instantiateViewControllerWithIdentifier:@"CoverViewController"];
_coverView = vc.view;
}
return _coverView;
}
- (void)setCoverPage {
[self.window addSubview:self.coverView];
}
- (void)removeCoverPage {
[self.coverView removeFromSuperview];
}
- (void)applicationWillResignActive:(UIApplication *)application
{
[self setCoverPage];
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
[self removeCoverPage];
}
- 14. 装飾する際の注意
・カードのサイズは以下
Device
| Card size
| Device screen size
---------------|-----------------------------------3.5" iPhone(r) | 304 x 456
|
640 x 960
4.0" iPhone(r) | 304 x 540
|
640 x 1136
iPad
| 384 x 512
|
1024 x 768
iPad (retina) | 768 x 1024 |
2048 x 1536
・テキストはかなり大きめにする
・BackgroundFetchで随時変更も可
- ScreenShotの方向は
EnterBackground 時のもので固定