SlideShare a Scribd company logo
1 of 22
Download to read offline
• 



•
•
• ホームスクリーンから、ユーザー
が頻繁することを素早く行うこ
とが可能

• 最後に閲覧したデータに、一回
でアクセスするような機能を提
供することが可能
•
•
•
• 画面遷移せずとも、コンテンツ
をプレビューすることが可能

• 一回一回画面遷移して戻るを繰
り返さなくても、内容を覗ける
ので内容を素早く確認可能
•
•
•
if ([self.traitCollection
respondsToSelector:@selector(forceTouchCapability)] &&
self.traitCollection.forceTouchCapability ==UIForceTouchCapabilityAvailable)
{
self.previewingContext =
[self registerForPreviewingWithDelegate:self sourceView:self.collectionView];
}
- (UIViewController *)previewingContext:(id<UIViewControllerPreviewing>)previewingContext
viewControllerForLocation:(CGPoint)location {
UICollectionView *collectionView = self.collectionView;
NSIndexPath *indexPath = [collectionView indexPathForItemAtPoint:location];
if (!indexPath) {
return nil;
}
if (![self collectionView:collectionView shouldSelectItemAtIndexPath:indexPath]) {
return nil;
}
UICollectionViewCell *cell = [collectionView cellForItemAtIndexPath:indexPath];
previewingContext.sourceRect = cell.frame;
// [...]
}
•
•
- (UIViewController *)previewingContext:(id<UIViewControllerPreviewing>)previewingContext
viewControllerForLocation:(CGPoint)location {
// [...]
UICollectionViewCell *cell = [collectionView cellForItemAtIndexPath:indexPath];
previewingContext.sourceRect = cell.frame;
[cell resetAllGestures]; // <-
// [...]
}
// [...]
- (void)resetAllGestures {
NSMutableArray *gestures =
[NSMutableArray arrayWithArray:self.tileItemView.gestureRecognizers];
[gestures addObjectsFromArray:self.listItemView.gestureRecognizers];
for (UIGestureRecognizer *recognizer in gestures) {
recognizer.enabled = NO;
recognizer.enabled = YES;
}
}
•
•
•
•
Enhancements with 3D Touch

More Related Content

Viewers also liked (10)

バグのことは嫌いになってもXcodeのことは嫌いにならないでください。
バグのことは嫌いになってもXcodeのことは嫌いにならないでください。バグのことは嫌いになってもXcodeのことは嫌いにならないでください。
バグのことは嫌いになってもXcodeのことは嫌いにならないでください。
 
TestFlightみたいなのを自作する
TestFlightみたいなのを自作するTestFlightみたいなのを自作する
TestFlightみたいなのを自作する
 
To learn Interpolator
To learn InterpolatorTo learn Interpolator
To learn Interpolator
 
3D touch for iOS
3D touch for iOS3D touch for iOS
3D touch for iOS
 
tvOSでWebSocketを使う
tvOSでWebSocketを使うtvOSでWebSocketを使う
tvOSでWebSocketを使う
 
UIKit Sound
UIKit SoundUIKit Sound
UIKit Sound
 
Enumerate
EnumerateEnumerate
Enumerate
 
What's new Swift3
What's new Swift3What's new Swift3
What's new Swift3
 
Framework code reading
Framework code readingFramework code reading
Framework code reading
 
MySQL 8.0で憶えておいてほしいこと
MySQL 8.0で憶えておいてほしいことMySQL 8.0で憶えておいてほしいこと
MySQL 8.0で憶えておいてほしいこと
 

Similar to Enhancements with 3D Touch

20121201yidev hirobe iPad miniでRetina
20121201yidev hirobe iPad miniでRetina20121201yidev hirobe iPad miniでRetina
20121201yidev hirobe iPad miniでRetina
Kazuya Hirobe
 

Similar to Enhancements with 3D Touch (20)

WKWebViewとUIWebView
WKWebViewとUIWebViewWKWebViewとUIWebView
WKWebViewとUIWebView
 
HTML5最新動向
HTML5最新動向HTML5最新動向
HTML5最新動向
 
Cocoa勉強会#50-ストーリーボードとセグウェイ
Cocoa勉強会#50-ストーリーボードとセグウェイCocoa勉強会#50-ストーリーボードとセグウェイ
Cocoa勉強会#50-ストーリーボードとセグウェイ
 
Road to UI Library
Road to UI LibraryRoad to UI Library
Road to UI Library
 
jQuery Mobile(開発編)勉強会資料
jQuery Mobile(開発編)勉強会資料jQuery Mobile(開発編)勉強会資料
jQuery Mobile(開発編)勉強会資料
 
Service worker が拓く mobile web の新しいかたち
Service worker が拓く mobile web の新しいかたちService worker が拓く mobile web の新しいかたち
Service worker が拓く mobile web の新しいかたち
 
2012 05-19第44回cocoa勉強会発表資料
2012 05-19第44回cocoa勉強会発表資料2012 05-19第44回cocoa勉強会発表資料
2012 05-19第44回cocoa勉強会発表資料
 
iOS WebView App
iOS WebView AppiOS WebView App
iOS WebView App
 
Selenium webdriver使ってみようず
Selenium webdriver使ってみようずSelenium webdriver使ってみようず
Selenium webdriver使ってみようず
 
HTML5&API総まくり
HTML5&API総まくりHTML5&API総まくり
HTML5&API総まくり
 
Internet Explorer 9 の新機能「固定サイト」 (Pinned sites)
Internet Explorer 9 の新機能「固定サイト」 (Pinned sites)Internet Explorer 9 の新機能「固定サイト」 (Pinned sites)
Internet Explorer 9 の新機能「固定サイト」 (Pinned sites)
 
メトロスタイルアプリ開発 最初の一歩
メトロスタイルアプリ開発最初の一歩メトロスタイルアプリ開発最初の一歩
メトロスタイルアプリ開発 最初の一歩
 
Core Animation 使って見た
Core Animation 使って見たCore Animation 使って見た
Core Animation 使って見た
 
iOSにおけるUIテスト@potetotips
iOSにおけるUIテスト@potetotipsiOSにおけるUIテスト@potetotips
iOSにおけるUIテスト@potetotips
 
Swift入門
Swift入門Swift入門
Swift入門
 
Web development fundamental
Web development fundamentalWeb development fundamental
Web development fundamental
 
UIViewController のコンテナ機能
UIViewController のコンテナ機能UIViewController のコンテナ機能
UIViewController のコンテナ機能
 
iOS 9 Bootcamp #6 UIKit
iOS 9 Bootcamp #6 UIKitiOS 9 Bootcamp #6 UIKit
iOS 9 Bootcamp #6 UIKit
 
Type Safe Assets Handling in Swift
Type Safe Assets Handling in SwiftType Safe Assets Handling in Swift
Type Safe Assets Handling in Swift
 
20121201yidev hirobe iPad miniでRetina
20121201yidev hirobe iPad miniでRetina20121201yidev hirobe iPad miniでRetina
20121201yidev hirobe iPad miniでRetina
 

Enhancements with 3D Touch