91
既存アプリの iOS8対応 Mao Nishi

既存アプリのiOS8対応 #ios8yahoo

  • Upload
    yahoo

  • View
    18.271

  • Download
    2

Embed Size (px)

DESCRIPTION

http://connpass.com/event/8629/

Citation preview

Page 1: 既存アプリのiOS8対応 #ios8yahoo

既存アプリの iOS8対応

Mao Nishi

Page 2: 既存アプリのiOS8対応 #ios8yahoo

今日話すこと• 今回のiOS8対応範囲

• ヤフオク!アプリで起きた問題

• Extension Today対応

• 掛かった工数

• ユーザの反響

Page 3: 既存アプリのiOS8対応 #ios8yahoo

ヤフオク!アプリについて

Page 4: 既存アプリのiOS8対応 #ios8yahoo
Page 5: 既存アプリのiOS8対応 #ios8yahoo

ヤフオク!アプリについて• iPhone版

• 2010年10月リリース(当時はiOS4.1)

• コード上でUI部品を生成している箇所多数

• iPad版

• 2013年12月リリース

• xib、storyboardは当然活用

Page 6: 既存アプリのiOS8対応 #ios8yahoo

今回のiOS8対応範囲について

Page 7: 既存アプリのiOS8対応 #ios8yahoo

ヤフオク!アプリの iOS8対応の範囲

iOS8での正常動作を目指す

iOS8独自機能(Extentionなどを

搭載)

iPhone6/iPhone6 Plus向けにレイアウトする

iPhone/iPad 対応済み! 対応済み! これから

Page 8: 既存アプリのiOS8対応 #ios8yahoo

ヤフオク!アプリの iOS8対応の範囲

iOS8での正常動作を目指す

iOS8独自機能(Extentionなどを

搭載)

iPhone6/iPhone6 Plus向けにレイアウトする

iPhone/iPad 対応済み! 対応済み! これから

Page 9: 既存アプリのiOS8対応 #ios8yahoo

iOS8対応時に出会った事象・不具合等を紹介します

Page 10: 既存アプリのiOS8対応 #ios8yahoo

これからiOS8対応にあたられる方の参考になればと思います

Page 11: 既存アプリのiOS8対応 #ios8yahoo

CASE 1 回転時にレイアウトが崩れる

Page 12: 既存アプリのiOS8対応 #ios8yahoo

とりあえずビルドして 動かしてみた

Page 13: 既存アプリのiOS8対応 #ios8yahoo

期待する動き

Page 14: 既存アプリのiOS8対応 #ios8yahoo

予期しない動き

Page 15: 既存アプリのiOS8対応 #ios8yahoo

回せば回すほど.. レイアウトが崩れていく事態に

Page 16: 既存アプリのiOS8対応 #ios8yahoo

原因

[[UIScreen mainScreen] applicationFrame];

Page 17: 既存アプリのiOS8対応 #ios8yahoo

原因

CGRect appFrame = [[UIScreen mainScreen] applicationFrame]; /* 以下はiOS8からは端末の向きによって返却される値が変わるようになった*/ CGFloat height = appFrame.size.height; CGFloat width = appFrame.size.width;

Page 18: 既存アプリのiOS8対応 #ios8yahoo

iOS7でのheightとwidthheight

heightwidth

width

長い方がheightという 前提でも成り立つ

Page 19: 既存アプリのiOS8対応 #ios8yahoo

iOS8でのheightとwidthheight

widthwidth

height

長い方がheightという 前提でコードを 書いてしまっていた

Page 20: 既存アプリのiOS8対応 #ios8yahoo

端末の向きにってheight、width に変化があるメソッド

• [[UIScreen mainScreen] applicationFrame]; • [[UIScreen mainScreen] bounds]; • [[UIApplication sharedApplication] statusBarFrame];

これらを使っている箇所は見直しましょう

Page 21: 既存アプリのiOS8対応 #ios8yahoo

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration;

回転検知時に呼ばれる処理も変更

Page 22: 既存アプリのiOS8対応 #ios8yahoo

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration;

回転検知時に呼ばれる処理も変更

- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id <UIViewControllerTransitionCoordinator>)coordinator;

回転検知ではなく、サイズが変更されたと考える

Page 23: 既存アプリのiOS8対応 #ios8yahoo

実際の対応内容//iOS7以前の画面回転開始時の処理 - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { //端末の向き取得 BOOL isLandscape = UIInterfaceOrientationIsLandscape(toInterfaceOrientation); //以降width、heightを取得して回転後の座標位置変更処理を行う }

Page 24: 既存アプリのiOS8対応 #ios8yahoo

実際の対応内容//iOS7以前の画面回転開始時の処理 - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { //端末の向き取得 BOOL isLandscape = UIInterfaceOrientationIsLandscape(toInterfaceOrientation); //以降width、heightを取得して回転後の座標位置変更処理を行う } !//iOS8以降のサイズ変更時(回転時)の処理 - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator { //端末の向き取得 BOOL isLandscape = (size.height <= size.width); //以降width、heightを取得して回転後の座標位置変更処理を行う }

Page 25: 既存アプリのiOS8対応 #ios8yahoo

実際の対応内容//iOS7以前の画面回転開始時の処理 - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { //端末の向き取得 BOOL isLandscape = UIInterfaceOrientationIsLandscape(toInterfaceOrientation); //以降width、heightを取得して回転後の座標位置変更処理を行う } !//iOS8以降のサイズ変更時(回転時)の処理 - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator { //端末の向き取得 BOOL isLandscape = (size.height <= size.width); //以降width、heightを取得して回転後の座標位置変更処理を行う }

Page 26: 既存アプリのiOS8対応 #ios8yahoo

CASE 2 罫線の左が切れる

Page 27: 既存アプリのiOS8対応 #ios8yahoo

罫線の左側が切れる問題

Page 28: 既存アプリのiOS8対応 #ios8yahoo

[UITableViewCell appearance].separatorInset = UIEdgeInsetsZero;

iOS7対応の時に行った処理

Page 29: 既存アプリのiOS8対応 #ios8yahoo

iOS8の新しいプロパティlayoutMarginsによりマージンが設定されている

(lldb) p (UIEdgeInsets)[self.tableView layoutMargins] (UIEdgeInsets) $1 = (top = 0, left = 16, bottom = 0, right = 16)

Page 30: 既存アプリのiOS8対応 #ios8yahoo

コンテンツのマージン 設定をオフにする

-(void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; self.tableView.layoutMargins = UIEdgeInsetsZero; }

Page 31: 既存アプリのiOS8対応 #ios8yahoo

コンテンツのマージン 設定をオフにする

-(void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; self.tableView.layoutMargins = UIEdgeInsetsZero; }

Page 32: 既存アプリのiOS8対応 #ios8yahoo

コンテンツのマージン 設定をオフにする

-(void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; self.tableView.layoutMargins = UIEdgeInsetsZero; }

Page 33: 既存アプリのiOS8対応 #ios8yahoo

CASE 3 デバイストークンが 取得できない

Page 34: 既存アプリのiOS8対応 #ios8yahoo

[[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIRemoteNotificationTypeBadge| UIRemoteNotificationTypeSound| UIRemoteNotificationTypeAlert)];

デバイストークン取得処理変更

Page 35: 既存アプリのiOS8対応 #ios8yahoo

[[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIRemoteNotificationTypeBadge| UIRemoteNotificationTypeSound| UIRemoteNotificationTypeAlert)];

デバイストークン取得処理変更

Page 36: 既存アプリのiOS8対応 #ios8yahoo

デバイストークン取得処理変更

//通知タイプの設定 UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert; !UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types categories:nil]; ![[UIApplication sharedApplication] registerUserNotificationSettings:settings]; !//Push通知の利用許可をとる [[UIApplication sharedApplication] registerForRemoteNotifications];

iOSバージョン毎に処理を分岐する必要がある

Page 37: 既存アプリのiOS8対応 #ios8yahoo

デバイストークン取得処理変更

//通知タイプの設定 UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert; !UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types categories:nil]; ![[UIApplication sharedApplication] registerUserNotificationSettings:settings]; !//Push通知の利用許可をとる [[UIApplication sharedApplication] registerForRemoteNotifications];

Page 38: 既存アプリのiOS8対応 #ios8yahoo

デバイストークン取得処理変更

//通知タイプの設定 UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert; !UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types categories:nil]; ![[UIApplication sharedApplication] registerUserNotificationSettings:settings]; !//Push通知の利用許可をとる [[UIApplication sharedApplication] registerForRemoteNotifications];

Page 39: 既存アプリのiOS8対応 #ios8yahoo

デバイストークン取得処理変更

//通知タイプの設定 UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert; !UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types categories:nil]; ![[UIApplication sharedApplication] registerUserNotificationSettings:settings]; !//Push通知の利用許可をとる [[UIApplication sharedApplication] registerForRemoteNotifications];

Page 40: 既存アプリのiOS8対応 #ios8yahoo

デバイストークン取得処理変更

//通知タイプの設定 UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert; !UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types categories:nil]; ![[UIApplication sharedApplication] registerUserNotificationSettings:settings]; !//Push通知の利用許可をとる [[UIApplication sharedApplication] registerForRemoteNotifications];

Page 41: 既存アプリのiOS8対応 #ios8yahoo

デバイストークン取得処理変更

//通知タイプの設定 UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert; !UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types categories:nil]; ![[UIApplication sharedApplication] registerUserNotificationSettings:settings]; !//Push通知の利用許可をとる [[UIApplication sharedApplication] registerForRemoteNotifications];

iOSバージョン毎に処理を分岐する必要がある

Page 42: 既存アプリのiOS8対応 #ios8yahoo

+ (void)registerNotification { //iOS8とそれ以外で設定を変更する必要がある if ([YJUtil isIOS8]){ [AucNotificationConfigure registerNotificationAfteriOS8]; } else { [AucNotificationConfigure registerNotificationBeforeiOS7]; } }

OSバージョンで分岐させてます

Page 43: 既存アプリのiOS8対応 #ios8yahoo

InteractiveなPushにも 対応しています

Page 44: 既存アプリのiOS8対応 #ios8yahoo

+ (void)registerNotificationAfteriOS8 { UIMutableUserNotificationAction *bidAction = [[UIMutableUserNotificationAction alloc] init]; bidAction.identifier = XXXXXXX; bidAction.title = @"入札する"; bidAction.activationMode = UIUserNotificationActivationModeForeground; bidAction.destructive = NO; bidAction.authenticationRequired = NO; UIMutableUserNotificationCategory *inviteCategory = [[UIMutableUserNotificationCategory alloc] init]; inviteCategory.identifier = XXXXXXX; [inviteCategory setActions:@[bidAction] forContext:UIUserNotificationActionContextMinimal]; //通知タイプの設定 UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert; NSSet *categories = [NSSet setWithObject:inviteCategory]; UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types categories:categories]; [[UIApplication sharedApplication] registerUserNotificationSettings:settings]; //Push通知の利用許可をとる [[UIApplication sharedApplication] registerForRemoteNotifications]; }

iOS8以後の処理

Page 45: 既存アプリのiOS8対応 #ios8yahoo

+ (void)registerNotificationAfteriOS8 { UIMutableUserNotificationAction *bidAction = [[UIMutableUserNotificationAction alloc] init]; bidAction.identifier = XXXXXXX; bidAction.title = @"入札する"; bidAction.activationMode = UIUserNotificationActivationModeForeground; bidAction.destructive = NO; bidAction.authenticationRequired = NO; UIMutableUserNotificationCategory *inviteCategory = [[UIMutableUserNotificationCategory alloc] init]; inviteCategory.identifier = XXXXXXX; [inviteCategory setActions:@[bidAction] forContext:UIUserNotificationActionContextMinimal]; //通知タイプの設定 UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert; NSSet *categories = [NSSet setWithObject:inviteCategory]; UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types categories:categories]; [[UIApplication sharedApplication] registerUserNotificationSettings:settings]; //Push通知の利用許可をとる [[UIApplication sharedApplication] registerForRemoteNotifications]; }

iOS8以後の処理

Page 46: 既存アプリのiOS8対応 #ios8yahoo

+ (void)registerNotificationAfteriOS8 { UIMutableUserNotificationAction *bidAction = [[UIMutableUserNotificationAction alloc] init]; bidAction.identifier = XXXXXXX; bidAction.title = @"入札する"; bidAction.activationMode = UIUserNotificationActivationModeForeground; bidAction.destructive = NO; bidAction.authenticationRequired = NO; UIMutableUserNotificationCategory *inviteCategory = [[UIMutableUserNotificationCategory alloc] init]; inviteCategory.identifier = XXXXXXX; [inviteCategory setActions:@[bidAction] forContext:UIUserNotificationActionContextMinimal]; //通知タイプの設定 UIUserNotificationType types = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert; NSSet *categories = [NSSet setWithObject:inviteCategory]; UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:types categories:categories]; [[UIApplication sharedApplication] registerUserNotificationSettings:settings]; //Push通知の利用許可をとる [[UIApplication sharedApplication] registerForRemoteNotifications]; }

iOS8以後の処理

Page 47: 既存アプリのiOS8対応 #ios8yahoo

CASE 4 iPadでカメラが反応しない

Page 48: 既存アプリのiOS8対応 #ios8yahoo

UIImagePickerController * picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.sourceType = UIImagePickerControllerSourceTypeCamera; ![self presentViewController:picker animated:YES completion:nil];

iPadでカメラ撮影する時

Page 49: 既存アプリのiOS8対応 #ios8yahoo

UIImagePickerController * picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.sourceType = UIImagePickerControllerSourceTypeCamera; ![self presentViewController:picker animated:YES completion:nil];

iPadでカメラ撮影する時

Page 50: 既存アプリのiOS8対応 #ios8yahoo

iPadでカメラ撮影する時

非同期で起動しないと固まってしまう

UIImagePickerController * picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.sourceType = UIImagePickerControllerSourceTypeCamera; !dispatch_async(dispatch_get_main_queue(), ^ { [self presentViewController:picker animated:YES completion:nil]; });

Page 51: 既存アプリのiOS8対応 #ios8yahoo

iPadでカメラ撮影する時

非同期で起動しないと固まってしまう

UIImagePickerController * picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.sourceType = UIImagePickerControllerSourceTypeCamera; !dispatch_async(dispatch_get_main_queue(), ^ { [self presentViewController:picker animated:YES completion:nil]; });

Page 52: 既存アプリのiOS8対応 #ios8yahoo

iPadでカメラ撮影する時

非同期で起動しないと固まってしまう

UIImagePickerController * picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.sourceType = UIImagePickerControllerSourceTypeCamera; if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) { dispatch_async(dispatch_get_main_queue(), ^ { [self presentViewController:picker animated:YES completion:nil]; }); } else { [self presentViewController:picker animated:YES completion:nil]; }

Page 53: 既存アプリのiOS8対応 #ios8yahoo

iPadでアルバムから写真を選択する際も同様

Page 54: 既存アプリのiOS8対応 #ios8yahoo

UIImagePickerController *imagePickerController = [[UIImagePickerController alloc]init]; imagePickerController.delegate = self; imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; !self.popover = [[UIPopoverController alloc] initWithContentViewController: imagePickerController]; self.popover.delegate = self; if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) { dispatch_async(dispatch_get_main_queue(), ^ { [self.popover presentPopoverFromRect:cell.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; }); } else { [self.popover presentPopoverFromRect:cell.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; }

iPadでアルバムから写真を選択する際も同様

非同期で起動しないと固まってしまう

Page 55: 既存アプリのiOS8対応 #ios8yahoo

UIImagePickerController *imagePickerController = [[UIImagePickerController alloc]init]; imagePickerController.delegate = self; imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; !self.popover = [[UIPopoverController alloc] initWithContentViewController: imagePickerController]; self.popover.delegate = self; if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) { dispatch_async(dispatch_get_main_queue(), ^ { [self.popover presentPopoverFromRect:cell.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; }); } else { [self.popover presentPopoverFromRect:cell.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; }

iPadでアルバムから写真を選択する際も同様

非同期で起動しないと固まってしまう

Page 56: 既存アプリのiOS8対応 #ios8yahoo

UIImagePickerController *imagePickerController = [[UIImagePickerController alloc]init]; imagePickerController.delegate = self; imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; !self.popover = [[UIPopoverController alloc] initWithContentViewController: imagePickerController]; self.popover.delegate = self; if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) { dispatch_async(dispatch_get_main_queue(), ^ { [self.popover presentPopoverFromRect:cell.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; }); } else { [self.popover presentPopoverFromRect:cell.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; }

iPadでアルバムから写真を選択する際も同様

非同期で起動しないと固まってしまう

Page 57: 既存アプリのiOS8対応 #ios8yahoo

UIImagePickerController *imagePickerController = [[UIImagePickerController alloc]init]; imagePickerController.delegate = self; imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; !self.popover = [[UIPopoverController alloc] initWithContentViewController: imagePickerController]; self.popover.delegate = self; if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) { dispatch_async(dispatch_get_main_queue(), ^ { [self.popover presentPopoverFromRect:cell.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; }); } else { [self.popover presentPopoverFromRect:cell.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; }

iPadでアルバムから写真を選択する際も同様

非同期で起動しないと固まってしまう

Page 58: 既存アプリのiOS8対応 #ios8yahoo

CASE 5 タブ画像が表示されない

Page 59: 既存アプリのiOS8対応 #ios8yahoo

タブ画像が表示されない問題

Page 60: 既存アプリのiOS8対応 #ios8yahoo

- (void)setFinishedSelectedImage:(UIImage *)selectedImage withFinishedUnselectedImage:(UIImage *)unselectedImage;

Page 61: 既存アプリのiOS8対応 #ios8yahoo

- (void)setFinishedSelectedImage:(UIImage *)selectedImage withFinishedUnselectedImage:(UIImage *)unselectedImage;

setFinishedSelectedImageはDepricated

Page 62: 既存アプリのiOS8対応 #ios8yahoo

setFinishedSelectedImageはDepricated

UIImage *m1 = [[UIImage imageNamed:@"m1.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

!UIImage *m2 = [[UIImage imageNamed:@"m2.png"]

imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; !

UITabBarItem *tab = [[UITabBarItem alloc] initWithTitle:@"" image:m1 selectedImage:m2];

Page 63: 既存アプリのiOS8対応 #ios8yahoo

setFinishedSelectedImageはDepricated

UIImage *m1 = [[UIImage imageNamed:@"m1.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

!UIImage *m2 = [[UIImage imageNamed:@"m2.png"]

imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; !

UITabBarItem *tab = [[UITabBarItem alloc] initWithTitle:@"" image:m1 selectedImage:m2];

Page 64: 既存アプリのiOS8対応 #ios8yahoo

setFinishedSelectedImageはDepricated

UIImage *m1 = [[UIImage imageNamed:@"m1.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

!UIImage *m2 = [[UIImage imageNamed:@"m2.png"]

imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; !

UITabBarItem *tab = [[UITabBarItem alloc] initWithTitle:@"" image:m1 selectedImage:m2];

UIImageRenderingModeAlwaysOriginalと共に生成する

Page 65: 既存アプリのiOS8対応 #ios8yahoo

CASE 6 Extentionの共通ロジックどうする

問題

Page 66: 既存アプリのiOS8対応 #ios8yahoo

アプリ本体とExtentionで 利用する共通部品クラスにおいて

[UIApplication sharedApplication] が使われているメソッドがある

色々な事情で共通部品クラスに 大きな修正を加えることができませんでした

Page 67: 既存アプリのiOS8対応 #ios8yahoo

+ (UIApplication *)sharedApplication NS_EXTENSION_UNAVAILABLE_IOS("Use view controller based solutions where appropriate instead.");

NS_EXTENSION_UNAVAILABLE_IOS のメソッドはExtention内では利用できない

Page 68: 既存アプリのiOS8対応 #ios8yahoo

!!// 特定のアプリを起動する void launchXXXXX(NSString* message) { NSString* url = [NSString stringWithFormat: @"%@://XXXXX/?message=%@", kXXXXSchemes, message]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]]; } !

どうするべきか

Page 69: 既存アプリのiOS8対応 #ios8yahoo

#ifndef AUC_WIDGET !// 特定のアプリを起動する void launchXXXXX(NSString* message) { NSString* url = [NSString stringWithFormat: @"%@://XXXXX/?message=%@", kXXXXSchemes, message]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]]; } #endif

Preprocessor Macroを使う方法

Page 70: 既存アプリのiOS8対応 #ios8yahoo

できるだけ共通部品から取り除くべきですが、 一手段として参考にしてください

#ifndef AUC_WIDGET !// 特定のアプリを起動する void launchXXXXX(NSString* message) { NSString* url = [NSString stringWithFormat: @"%@://XXXXX/?message=%@", kXXXXSchemes, message]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]]; } #endif

Preprocessor Macroを使う方法

Page 71: 既存アプリのiOS8対応 #ios8yahoo

ExtentionのPreprocessor Macroの設定例

Page 72: 既存アプリのiOS8対応 #ios8yahoo

Extention Today対応

Page 73: 既存アプリのiOS8対応 #ios8yahoo
Page 74: 既存アプリのiOS8対応 #ios8yahoo

Extention Todayについて• ガイドライン上、スクロールできるUIはユーザにとって好ましくないとの記述がある

• ヤフオク!では入札中の商品を一覧できるExtention

Todayを作成したかった

• 一覧から入札できればなお良い(でもウィジェットではキーボードは利用できない)

Page 75: 既存アプリのiOS8対応 #ios8yahoo
Page 76: 既存アプリのiOS8対応 #ios8yahoo
Page 77: 既存アプリのiOS8対応 #ios8yahoo
Page 78: 既存アプリのiOS8対応 #ios8yahoo
Page 79: 既存アプリのiOS8対応 #ios8yahoo
Page 80: 既存アプリのiOS8対応 #ios8yahoo
Page 81: 既存アプリのiOS8対応 #ios8yahoo

iOS8対応に 掛かった工数

Page 82: 既存アプリのiOS8対応 #ios8yahoo

iOS8対応に掛かった工数(iPhone)

iOS8での不具合修正

ウィジェット 作成

合計

制作 ー 3人日 3人日

開発 4人日 4人日 8人日

Page 83: 既存アプリのiOS8対応 #ios8yahoo

iOS8対応に掛かった工数(iPad)

iOS8での不具合修正

ウィジェット 作成

合計

制作 ー 0.5人日 0.5人日

開発 3人日 1人日 4人日

Page 84: 既存アプリのiOS8対応 #ios8yahoo

開発工数 iOS7対応>>>>>iOS8対応>iOS6対応

Page 85: 既存アプリのiOS8対応 #ios8yahoo

リリース後の反響

Page 86: 既存アプリのiOS8対応 #ios8yahoo
Page 87: 既存アプリのiOS8対応 #ios8yahoo
Page 88: 既存アプリのiOS8対応 #ios8yahoo
Page 89: 既存アプリのiOS8対応 #ios8yahoo

最後に

Page 90: 既存アプリのiOS8対応 #ios8yahoo

http://topic.auctions.yahoo.co.jp/promo/hr/p/

Page 91: 既存アプリのiOS8対応 #ios8yahoo

http://topic.auctions.yahoo.co.jp/promo/hr/p/