pub unsafe trait UIFocusItemContainer: NSObjectProtocol + MainThreadOnly {
// Provided methods
unsafe fn coordinateSpace(
&self,
) -> Retained<ProtocolObject<dyn UICoordinateSpace>>
where Self: Sized + Message { ... }
unsafe 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§
Sourceunsafe fn coordinateSpace(
&self,
) -> Retained<ProtocolObject<dyn UICoordinateSpace>>
Available on crate feature UIView only.
unsafe 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.
Sourceunsafe fn focusItemsInRect(
&self,
rect: CGRect,
) -> Retained<NSArray<ProtocolObject<dyn UIFocusItem>>>
Available on crate feature objc2-core-foundation only.
unsafe 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
UIResponder and UIView and UIActionSheet only.impl UIFocusItemContainer for UIActivityIndicatorView
UIResponder and UIView and UIActivityIndicatorView only.impl UIFocusItemContainer for UIAlertView
UIResponder and UIView and UIAlertView only.impl UIFocusItemContainer for UIButton
UIControl and UIResponder and UIView and UIButton only.impl UIFocusItemContainer for UICalendarView
UIResponder and UIView and UICalendarView only.impl UIFocusItemContainer for UICollectionReusableView
UIResponder and UIView and UICollectionViewCell only.impl UIFocusItemContainer for UICollectionView
UIResponder and UIScrollView and UIView and UICollectionView only.impl UIFocusItemContainer for UICollectionViewCell
UIResponder and UIView and UICollectionViewCell only.impl UIFocusItemContainer for UICollectionViewListCell
UICollectionViewCell and UIResponder and UIView and UICollectionViewListCell only.impl UIFocusItemContainer for UIColorWell
UIControl and UIResponder and UIView and UIColorWell only.impl UIFocusItemContainer for UIControl
UIResponder and UIView and UIControl only.impl UIFocusItemContainer for UIDatePicker
UIControl and UIResponder and UIView and UIDatePicker only.impl UIFocusItemContainer for UIEventAttributionView
UIResponder and UIView and UIEventAttributionView only.impl UIFocusItemContainer for UIImageView
UIResponder and UIView and UIImageView only.impl UIFocusItemContainer for UIInputView
UIResponder and UIView and UIInputView only.impl UIFocusItemContainer for UILabel
UIResponder and UIView and UILabel only.impl UIFocusItemContainer for UIListContentView
UIResponder and UIView and UIListContentConfiguration only.impl UIFocusItemContainer for UIPageControl
UIControl and UIResponder and UIView and UIPageControl only.impl UIFocusItemContainer for UIPasteControl
UIControl and UIResponder and UIView and UIPasteControl only.impl UIFocusItemContainer for UIPickerView
UIResponder and UIView and UIPickerView only.impl UIFocusItemContainer for UIPopoverBackgroundView
UIResponder and UIView and UIPopoverBackgroundView only.impl UIFocusItemContainer for UIProgressView
UIResponder and UIView and UIProgressView only.impl UIFocusItemContainer for UIRefreshControl
UIControl and UIResponder and UIView and UIRefreshControl only.impl UIFocusItemContainer for UIScrollView
UIResponder and UIView and UIScrollView only.impl UIFocusItemContainer for UISearchBar
UIResponder and UIView and UISearchBar only.impl UIFocusItemContainer for UISearchTextField
UIControl and UIResponder and UITextField and UIView and UISearchTextField only.impl UIFocusItemContainer for UISegmentedControl
UIControl and UIResponder and UIView and UISegmentedControl only.impl UIFocusItemContainer for UISlider
UIControl and UIResponder and UIView and UISlider only.impl UIFocusItemContainer for UIStackView
UIResponder and UIView and UIStackView only.impl UIFocusItemContainer for UIStandardTextCursorView
UIResponder and UIView and UIStandardTextCursorView only.impl UIFocusItemContainer for UIStepper
UIControl and UIResponder and UIView and UIStepper only.impl UIFocusItemContainer for UISwitch
UIControl and UIResponder and UIView and UISwitch only.impl UIFocusItemContainer for UITabBar
UIResponder and UIView and UITabBar only.impl UIFocusItemContainer for UITableView
UIResponder and UIScrollView and UIView and UITableView only.impl UIFocusItemContainer for UITableViewCell
UIResponder and UIView and UITableViewCell only.impl UIFocusItemContainer for UITextField
UIControl and UIResponder and UIView and UITextField only.impl UIFocusItemContainer for UITextView
UIResponder and UIScrollView and UIView and UITextView only.impl UIFocusItemContainer for UIToolbar
UIResponder and UIView and UIToolbar only.impl UIFocusItemContainer for UIView
UIResponder and UIView only.impl UIFocusItemContainer for UIVisualEffectView
UIResponder and UIView and UIVisualEffectView only.impl UIFocusItemContainer for UIWebView
UIResponder and UIView and UIWebView only.impl UIFocusItemContainer for UIWindow
UIResponder and UIView and UIWindow only.