Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Founder. Opencart
Top Partners
Flipping Notch is not a framework, it is just an Xcode project, embracing the notch.
1. Put a UICollectionView and constraint it in a ViewController.
The image below shows an example how to constraint it.
2. Add a cell in the UICollectionView.
3. Set up the UICollectionView in the ViewController by conforming to UICollectionViewDataSource.
4. The Notch View
notchViewBottomConstraint
After instantiating the notchView, add it as a subview its parent view. The notchView have a black background and rounded corners. translatesAutoResizingMaskIntoConstraints needs to be set to false because we want to use auto layout for this view rather than frame-based layout. Then, the notchView is constrained to the center of its parent view, with the same width as the notch, a height of (notch height - maximum scrolling offset what we want to give) and a bottom constrained to its parent view topAnchor + notch height.
translatesAutoResizingMaskIntoConstraints
false
(notch height - maximum scrolling offset what we want to give)
topAnchor
The result in an iPhone 8:
5. Reacting while scrolling
(Looks clearer in an iPhone 8 what we are trying to do)
scrollViewDidScroll
the maximum scrolling offset what we want to give
6. Drop the view from the notch
notchBottomConstraint
collectionView
7. Flip it
collectionview cell
animatableView
The animation works as expected only in iPhone X in portrait mode
For more Blogs please click here
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
Name
Email
Subject
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.