TL;DR I want to copy the UI and implementation of the iOS platform's Rich Notifications peek in my app, without reinventing the wheel if possible.
I’m trying to implement UI pretty much identical to Apple’s Rich Notifications on the iOS platform. I want to use it for my own notification listing in my app. They seem to have a custom implementation of the peek UI of Peek and Pop which differs in the following ways as far as I can tell:
- After you triggered the peek using 3D touch the UI is not dismissed when you lift your finger.
- The preview actions are shown immediately rather than requiring the user to swipe up.
- There is a dismissal icon in the form of a circle with a cross
I’ve been trying to see whether I could customize the Peek and Pop implementation in UIKit to mimic this behavior but it seems pretty uncustomizable.
I've found some guidance here but I want the rows in my tableview to dynamically be represented in the preview UI, exactly how it work with the various types of iOS notifications, matching the position of the row in the tableview and scaling accordingly.
Am I missing something or do I have to do as the link above states and make an entirely custom view controller that copies the Rich Notifications UI, including the preview action buttons? This would mean I'd have to deal with positioning and scaling the view controller as well. If at all possible I'd like to rely on things already implemented in the platform as much as possible since I’d hate to reinvent the wheel. I am using Swift 4.
For clarity I’ve added two screenshots of Apple’s Rich Notifications implementation to show what I’m talking about: