Book Image

Mastering iOS 12 Programming - Third Edition

By : Donny Wals
Book Image

Mastering iOS 12 Programming - Third Edition

By: Donny Wals

Overview of this book

The iOS development environment has significantly matured, and with Apple users spending more money in the App Store, there are plenty of development opportunities for professional iOS developers. However, the journey to mastering iOS development and the new features of iOS 12 is not straightforward. This book will help you make that transition smoothly and easily. With the help of Swift 4.2, you’ll not only learn how to program for iOS 12, but also how to write efficient, readable, and maintainable Swift code that maintains industry best practices. Mastering iOS 12 Programming will help you build real-world applications and reflect the real-world development flow. You will also find a mix of thorough background information and practical examples, teaching you how to start implementing your newly gained knowledge. By the end of this book, you will have got to grips with building iOS applications that harness advanced techniques and make best use of the latest and greatest features available in iOS 12.
Table of Contents (35 chapters)
Title Page
Copyright and Credits
Dedication
Packt Upsell
Contributors
Preface
Index

Enhancing the user experience with 3D Touch


One of iOS's lesser-used features is 3D Touch. 3D Touch allows users to perform special interactions with apps by pressing a little bit more firmly on the screen than usual. The iPhone 6s and newer devices support this functionality and it allows for some pretty neat interactions. One of these interactions is called peek and pop.

With peek and pop, a user can 3D Touch an element on the screen and they'll see a preview of the detail page they would see if they had performed a regular tap on the UI element. The following screenshot shows an example of such a preview:

 

If the user sees a preview like this and they press on their screen a little bit harder, the user commits to seeing this view and they will be taken to the detail page as if they had normally tapped on the contact. Implementing this feature requires only a small amount of effort.

To implement peek and pop, the source view controller must register its intent to display previews. The source...