3D Touch

作者: 苒妈 | 来源:发表于2016-04-22 18:05 被阅读16次

http://my.oschina.net/u/2340880/blog/511509

iOS 9 才支持,相关内容使用时必须判断系统版本。

包括三大模块:

        (1)Home Screen Quick Actions (菜单)

        (2)peek and pop

        (3)Force properties(力度)

1.静态标签 plist 

         UIApplicationShortCutItems <Array>

2.动态标签

         UIApplicationShortCutItemType

                                                  Title

                                                  SubTitle

                                                  Icon

                                                  UseInfo

3.UIApplicationDelegate

       通过UIApplicationLaunchOptionsShortCutItemKey获得UIApplicationShortCutItem

4.didFinishLaunchingWithOptions:

performActionForShorCutItem:会通过以上两个方法响应。

如果程序处于关闭状态,则在didFinishLaunchingWithOptions:通过3获得action,需返回NO。

如果程序处于后台状态,则在performActionForShorCutItem:激活。

5. peeking(按压) and poping(全屏)

if (UITraitController.forceTouchCapability == .available) {

     [self.registerForPreviewingWithDelegate:self sourceView:sourceView];

}

相关文章

网友评论

      本文标题:3D Touch

      本文链接:https://www.haomeiwen.com/subject/ydvglttx.html