pub unsafe trait UIFocusItemContainer: NSObjectProtocol + MainThreadOnly {
// Provided methods
fn coordinateSpace(&self) -> Retained<ProtocolObject<dyn UICoordinateSpace>>
where Self: Sized + Message { ... }
fn focusItemsInRect(
&self,
rect: CGRect,
) -> Retained<NSArray<ProtocolObject<dyn UIFocusItem>>>
where Self: Sized + Message { ... }
}UIFocus only.Expand description
Objects conforming to UIFocusItemContainer are responsible for providing which focus items they contain and where they are.
See also Apple’s documentation
Provided Methods§
Sourcefn coordinateSpace(&self) -> Retained<ProtocolObject<dyn UICoordinateSpace>>
Available on crate feature UIView only.
fn coordinateSpace(&self) -> Retained<ProtocolObject<dyn UICoordinateSpace>>
UIView only.The coordinate space of the focus items contained in this container. The focus items returned by focusItemsInRect: should report their frames in this coordinate space. If you are implementing this protocol, you may find it convenient to return the UIScreen as your coordinate space, and ensure that your contained items report their frames in screen space. Similarly, you might find that your focus items’ containing UIView or UIWindow is the most convenient coordinate space to use. You may also choose to implement your own object that conforms to UICoordinateSpace, if that is the most natural solution for your architecture.
Sourcefn focusItemsInRect(
&self,
rect: CGRect,
) -> Retained<NSArray<ProtocolObject<dyn UIFocusItem>>>
Available on crate feature objc2-core-foundation only.
fn focusItemsInRect( &self, rect: CGRect, ) -> Retained<NSArray<ProtocolObject<dyn UIFocusItem>>>
objc2-core-foundation only.Returns an array of all focus items within this container that intersect with the provided rect. rect is expressed in coordinateSpace.
Note: starting in iOS
&
tvOS 16.0, UIView will return its subviews from this method. If you override this method in a UIView subclass, it will be your responsibility to call super and merge your array of custom focus items with UIView’s default focus items.
Trait Implementations§
Source§impl ProtocolType for dyn UIFocusItemContainer
impl ProtocolType for dyn UIFocusItemContainer
impl<T> ImplementedBy<T> for dyn UIFocusItemContainer
Implementations on Foreign Types§
impl<T> UIFocusItemContainer for ProtocolObject<T>where
T: ?Sized + UIFocusItemContainer,
Implementors§
impl UIFocusItemContainer for UIActionSheet
UIActionSheet only.impl UIFocusItemContainer for UIActivityIndicatorView
UIActivityIndicatorView only.impl UIFocusItemContainer for UIAlertView
UIAlertView only.impl UIFocusItemContainer for UIBackgroundExtensionView
UIBackgroundExtensionView only.impl UIFocusItemContainer for UIButton
UIButton only.impl UIFocusItemContainer for UICalendarView
UICalendarView only.impl UIFocusItemContainer for UICollectionReusableView
UICollectionViewCell only.impl UIFocusItemContainer for UICollectionView
UICollectionView only.impl UIFocusItemContainer for UICollectionViewCell
UICollectionViewCell only.impl UIFocusItemContainer for UICollectionViewListCell
UICollectionViewListCell only.impl UIFocusItemContainer for UIColorWell
UIColorWell only.impl UIFocusItemContainer for UIControl
UIControl only.impl UIFocusItemContainer for UIDatePicker
UIDatePicker only.impl UIFocusItemContainer for UIEventAttributionView
UIEventAttributionView only.impl UIFocusItemContainer for UIImageView
UIImageView only.impl UIFocusItemContainer for UIInputView
UIInputView only.impl UIFocusItemContainer for UILabel
UILabel only.impl UIFocusItemContainer for UIListContentView
UIListContentConfiguration only.impl UIFocusItemContainer for UIPageControl
UIPageControl only.impl UIFocusItemContainer for UIPasteControl
UIPasteControl only.impl UIFocusItemContainer for UIPickerView
UIPickerView only.impl UIFocusItemContainer for UIPopoverBackgroundView
UIPopoverBackgroundView only.impl UIFocusItemContainer for UIProgressView
UIProgressView only.impl UIFocusItemContainer for UIRefreshControl
UIRefreshControl only.impl UIFocusItemContainer for UIScrollView
UIScrollView only.impl UIFocusItemContainer for UISearchBar
UISearchBar only.impl UIFocusItemContainer for UISearchTextField
UISearchTextField only.impl UIFocusItemContainer for UISegmentedControl
UISegmentedControl only.impl UIFocusItemContainer for UISlider
UISlider only.impl UIFocusItemContainer for UIStackView
UIStackView only.impl UIFocusItemContainer for UIStandardTextCursorView
UIStandardTextCursorView only.impl UIFocusItemContainer for UIStepper
UIStepper only.impl UIFocusItemContainer for UISwitch
UISwitch only.impl UIFocusItemContainer for UITabBar
UITabBar only.impl UIFocusItemContainer for UITableView
UITableView only.impl UIFocusItemContainer for UITableViewCell
UITableViewCell only.impl UIFocusItemContainer for UITextField
UITextField only.impl UIFocusItemContainer for UITextView
UITextView only.impl UIFocusItemContainer for UIToolbar
UIToolbar only.impl UIFocusItemContainer for UIView
UIView only.impl UIFocusItemContainer for UIVisualEffectView
UIVisualEffectView only.impl UIFocusItemContainer for UIWebView
UIWebView only.impl UIFocusItemContainer for UIWindow
UIWindow only.