Tuesday, September 19, 2023
HomeiOS Developmentios - Inset contents beneath sheet introduced with medium detent

ios – Inset contents beneath sheet introduced with medium detent


iOS 15 added UISheetPresentationController which allows you to implement a half-height sheet by setting sheetPresentationController‘s detents to [.medium()]. You can then set the largestUndimmedDetentIdentifier to .medium to allow interacting with the presenting view controller and the sheet so you can achieve an interface similar to Maps and Stocks.

My question is, how could you detect when an undimmed sheet is presented and get its height in order to inset content in the underlying screen(s). For example, I want to add content insets to my table view so that you can scroll to see all cells. Currently, the sheet covers up the bottom cells making it impossible to interact with those – you can only tap the ones that lie above where the sheet rests.




Please enter your comment!
Please enter your name here

Most Popular

Recent Comments