20150930 3D Touchを試す

Description
1. 3D Touchを試す 2015.9.30 関西モバイルアプリ研究会 #6 @itok_twit 2. @itok_twit ã いとうけい(itok) ã 公私共にプログラマ iOS /…

Please download to get full document.

View again

of 14
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Information
Category:

Software

Publish on:

Views: 115 | Pages: 14

Extension: PDF | Download: 0

Share
Transcript
  • 1. 3D Touchを試す 2015.9.30 関西モバイルアプリ研究会 #6 @itok_twit
  • 2. @itok_twit • いとうけい(itok) • 公私共にプログラマ iOS / Mac(たまに Android や Windows) • http://itok.jp/
  • 3. 3D Touch
  • 4. 3D Touch • UITouch • UIApplicationShortcutItem • UIViewControllerPreviewing
  • 5. はじめに • 3D Touchが使えるか? • UITraitCollection.forceTouchCapability で確認 • シミュレータでは使えません
  • 6. UITouch • force touch具合を直接取得できる public var force: CGFloat { get } public var maximumPossibleForce: CGFloat { get } • touchesMovedが大量に呼ばれるので注意
  • 7. UIApplicationShortcutItem
  • 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. UIApplicationShortcutItem • UIApplicationDelegateで受け取る func application(application: UIApplication, performActionForShortcutItem shortcutItem: UIApplicationShortcutItem, completionHandler: (Bool) -> Void)
  • 10. UIViewControllerPreviewing
  • 11. UIViewControllerPreviewing • Previewingに対応するViewを指定する extension UIViewController { public func registerForPreviewingWithDelegate( delegate: UIViewControllerPreviewingDelegate, sourceView: UIView) -> UIViewControllerPreviewing }
  • 12. UIViewControllerPreviewing • UIViewControllerPreviewingDelegateを実装 protocol UIViewControllerPreviewingDelegate { public func previewingContext( previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) -> UIViewController? public func previewingContext( previewingContext: UIViewControllerPreviewing, commitViewController viewControllerToCommit: UIViewController) }
  • 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. 3D Touch • UITouchを使っているコード(UIViewのサブクラ スなど)は要注意 • UIApplicationShortcutItemは結構使えそう • UIViewControllerPreviewingもmaster-detail的ナ ビゲーションでは使えそう
  • We Need Your Support
    Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

    Thanks to everyone for your continued support.

    No, Thanks