Configure 3D Touch functionality for your app

Source: Internet
Author: User
Tags home screen

With the launch of the iphone 6s and iphone 6s Plus, developers can now have a 3D Touch feature for their app, which opens up a new dimension for interacting with the interface.

As Apple says, developers can use 3D Touch through a very simple API, essentially a simple new property of Uitouch.

Override event: Uievent? ) {     elsereturn  }     if traitcollection.forcetouchcapability = =  . Available {        println ("Touch pressure is \ (Touch.force), maximum possible Touch.maximumpossibleforce)     }}

This new API allows applications to play a huge role, such as additional control options in the game, fine-grained (fine-grained) control in drawing applications, and even a great choice to replace the long-press operation (Tap-and-hold) we used on IOS devices.

In addition to the new APIs in Uitouch, Apple has provided two sets of classes to add 3D Touch functionality to the app: Uipreviewaction and Uiapplicationshortcutitem.

Uipreviewaction allows developers to quickly display something in a new preview window when the user touches a UI element using the 3D Touch feature. This fast-browsing approach to application-specific content is really great, for example, when we can quickly preview email messages, photos, and even web content without having to pop up a full view controller.

The Uiapplicationshortcutitem object enables an amazing new feature to be activated on the IOS home screen. When a user presses an app's icon with 3D Touch, a list of options pops up, allowing the user to quickly jump to a specific part of the app or perform a function within an app.

All in all, the introduction of 3D Touch unlocks a whole new way of interacting with iOS devices, and will bring new generations of innovation to the next iOS app.

Configure 3D Touch functionality for your app

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.