Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
3D Touchを試す
2015.9.30 関西モバイルアプリ研究会 #6
@itok_twit
@itok_twit
• いとうけい(itok)
• 公私共にプログラマ iOS / Mac(たまに Android や Windows)
• http://itok.jp/
3D Touch
3D Touch
• UITouch
• UIApplicationShortcutItem
• UIViewControllerPreviewing
はじめに
• 3D Touchが使えるか?
• UITraitCollection.forceTouchCapability で確認
• シミュレータでは使えません
UITouch
• force touch具合を直接取得できる
public var force: CGFloat { get }
public var maximumPossibleForce: CGFloat { get }
• touch...
UIApplicationShortcutItem
UIApplicationShortcutItem
• Info.plistに静的に宣言
→UIApplicationShortcutItems
• UIApplication.shortcutItemsで動的に変更
public class ...
UIApplicationShortcutItem
• UIApplicationDelegateで受け取る
func application(application: UIApplication,
performActionForShortc...
UIViewControllerPreviewing
UIViewControllerPreviewing
• Previewingに対応するViewを指定する
extension UIViewController {
public func registerForPreviewingWithDe...
UIViewControllerPreviewing
• UIViewControllerPreviewingDelegateを実装
protocol UIViewControllerPreviewingDelegate {
public fu...
UIViewControllerPreviewing
• メニューはUIViewController.previewActionItems()で宣言
class UIPreviewAction : NSObject, UIPreviewActi...
3D Touch
• UITouchを使っているコード(UIViewのサブクラ
スなど)は要注意
• UIApplicationShortcutItemは結構使えそう
• UIViewControllerPreviewingもmaster-de...
Upcoming SlideShare
Loading in …5
×

20150930 3D Touchを試す

2,025 views

Published on

関西モバイルアプリ研究会 #6
「3D Touchを試す」の資料です

Published in: Software
  • Be the first to comment

20150930 3D Touchを試す

  1. 1. 3D Touchを試す 2015.9.30 関西モバイルアプリ研究会 #6 @itok_twit
  2. 2. @itok_twit • いとうけい(itok) • 公私共にプログラマ iOS / Mac(たまに Android や Windows) • http://itok.jp/
  3. 3. 3D Touch
  4. 4. 3D Touch • UITouch • UIApplicationShortcutItem • UIViewControllerPreviewing
  5. 5. はじめに • 3D Touchが使えるか? • UITraitCollection.forceTouchCapability で確認 • シミュレータでは使えません
  6. 6. UITouch • force touch具合を直接取得できる public var force: CGFloat { get } public var maximumPossibleForce: CGFloat { get } • touchesMovedが大量に呼ばれるので注意
  7. 7. UIApplicationShortcutItem
  8. 8. UIApplicationShortcutItem • Info.plistに静的に宣言 →UIApplicationShortcutItems • UIApplication.shortcutItemsで動的に変更 public class UIApplicationShortcutItem : NSObject { public init(type: String, localizedTitle: String, localizedSubtitle: String?, icon: UIApplicationShortcutIcon?, userInfo: [NSObject : AnyObject]?) }
  9. 9. UIApplicationShortcutItem • UIApplicationDelegateで受け取る func application(application: UIApplication, performActionForShortcutItem shortcutItem: UIApplicationShortcutItem, completionHandler: (Bool) -> Void)
  10. 10. UIViewControllerPreviewing
  11. 11. UIViewControllerPreviewing • Previewingに対応するViewを指定する extension UIViewController { public func registerForPreviewingWithDelegate( delegate: UIViewControllerPreviewingDelegate, sourceView: UIView) -> UIViewControllerPreviewing }
  12. 12. UIViewControllerPreviewing • UIViewControllerPreviewingDelegateを実装 protocol UIViewControllerPreviewingDelegate { public func previewingContext( previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController? public func previewingContext( previewingContext: UIViewControllerPreviewing, commitViewController viewControllerToCommit: UIViewController) }
  13. 13. UIViewControllerPreviewing • メニューはUIViewController.previewActionItems()で宣言 class UIPreviewAction : NSObject, UIPreviewActionItem { public convenience init(      title: String,      style: UIPreviewActionStyle,      handler: (UIPreviewAction, UIViewController) -> Void) } class UIPreviewActionGroup : NSObject, UIPreviewActionItem { public convenience init(      title: String,      style: UIPreviewActionStyle,      actions: [UIPreviewAction]) } • UIPreviewActionGroupでサブメニューも作れる
  14. 14. 3D Touch • UITouchを使っているコード(UIViewのサブクラ スなど)は要注意 • UIApplicationShortcutItemは結構使えそう • UIViewControllerPreviewingもmaster-detail的ナ ビゲーションでは使えそう

×