pub enum Detent {
Medium,
Large,
Custom(f64),
}Expand description
A height a sheet rests at.
iPad in regular width ignores detents: UIKit presents a page sheet
there as a centered form sheet at a fixed size, and only an edge-attached
presentation (compact width, or compact height with
prefersEdgeAttachedInCompactHeight) honours them — see
docs/LIMITATIONS.md’s native-sheet-ipad-regular-width-detents. Never
assume detent parity across idioms.
Variants§
Medium
About half the screen height (UIKit’s mediumDetent).
Large
The full-height sheet (UIKit’s largeDetent).
Custom(f64)
A fraction 0 < f <= 1 of the largest height the sheet can take.
Needs iOS 16 (customDetentWithIdentifier:resolver:), checked at
runtime: below it the arm substitutes the nearest of Self::Medium
(f <= 0.75) or Self::Large and logs once, and
SheetSpec::on_detent then reports that substitute.
Trait Implementations§
impl Copy for Detent
impl StructuralPartialEq for Detent
Auto Trait Implementations§
impl Freeze for Detent
impl RefUnwindSafe for Detent
impl Send for Detent
impl Sync for Detent
impl Unpin for Detent
impl UnsafeUnpin for Detent
impl UnwindSafe for Detent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.