pub unsafe trait UIFocusItem: UIFocusEnvironment + MainThreadOnly {
// Provided methods
fn canBecomeFocused(&self) -> bool
where Self: Sized + Message { ... }
fn frame(&self) -> CGRect
where Self: Sized + Message { ... }
fn focusEffect(&self) -> Option<Retained<UIFocusEffect>>
where Self: Sized + Message { ... }
fn focusGroupPriority(&self) -> UIFocusGroupPriority
where Self: Sized + Message { ... }
fn focusItemDeferralMode(&self) -> UIFocusItemDeferralMode
where Self: Sized + Message { ... }
fn isTransparentFocusItem(&self) -> bool
where Self: Sized + Message { ... }
fn didHintFocusMovement(&self, hint: &UIFocusMovementHint)
where Self: Sized + Message { ... }
}UIFocus only.Expand description
Objects conforming to UIFocusItem are considered capable of participating in focus. Only UIFocusItems can ever be focused.
See also Apple’s documentation
Provided Methods§
Sourcefn canBecomeFocused(&self) -> bool
fn canBecomeFocused(&self) -> bool
Indicates whether or not this item is currently allowed to become focused. Returning NO restricts the item from being focusable, even if it is visible in the user interface. For example, UIControls return NO if they are disabled.
Sourcefn frame(&self) -> CGRect
Available on crate feature objc2-core-foundation only.
fn frame(&self) -> CGRect
objc2-core-foundation only.The geometric frame of this item, represented in the coordinateSpace of the UIFocusItemContainer in which it is contained.
Sourcefn focusEffect(&self) -> Option<Retained<UIFocusEffect>>
Available on crate feature UIFocusEffect only.
fn focusEffect(&self) -> Option<Retained<UIFocusEffect>>
UIFocusEffect only.Describes a visual effect to apply when this item is focused. When not implemented, the system may create a default effect for this item. Returning nil indicates that the system should not apply any visual effects, and that the app will handle applying the appropriate visuals.
Sourcefn focusGroupPriority(&self) -> UIFocusGroupPriority
fn focusGroupPriority(&self) -> UIFocusGroupPriority
The priority this item has in its focus group. The higher the priority, the more likely it is to get picked when focus moves into this group. Note: this method can only be used to increase an item’s priority, not decrease it. For example if an item is currently selected, the actual priority of this item will be determined by MAX(focusGroupPriority, UIFocusGroupPrioritySelected).
Sourcefn focusItemDeferralMode(&self) -> UIFocusItemDeferralMode
fn focusItemDeferralMode(&self) -> UIFocusItemDeferralMode
If this property is present and returns UIFocusItemDeferralModeNever, the focus deferral will not be enabled again
after the user engagement timeout has expired if this item is currently focused and programmatic focus updates pointing
to this item will be executed immediatly. If it returns UIFocusItemDeferralModeAlways focus will always be deferred
when this item is supposed to be focused.
Does nothing when focus deferral is not supported on the platform.
Sourcefn isTransparentFocusItem(&self) -> bool
fn isTransparentFocusItem(&self) -> bool
If this returns YES, the focus item is considered transparent in terms of occlusion. Items that are behind it are focusable. This value is ignored when the item is focusable, in which case the item is never considered transparent.
Sourcefn didHintFocusMovement(&self, hint: &UIFocusMovementHint)
Available on crate feature UIFocusMovementHint only.
fn didHintFocusMovement(&self, hint: &UIFocusMovementHint)
UIFocusMovementHint only.Called whenever this focus item is hinting to the user a focus movement might occur. The provided object is mutated by the focus engine whenever the user’s finger moves.
Trait Implementations§
Source§impl ProtocolType for dyn UIFocusItem
impl ProtocolType for dyn UIFocusItem
impl<T> ImplementedBy<T> for dyn UIFocusItem
Implementations on Foreign Types§
impl<T> UIFocusItem for ProtocolObject<T>where
T: ?Sized + UIFocusItem,
Implementors§
impl UIFocusItem for UIActionSheet
UIActionSheet only.impl UIFocusItem for UIActivityIndicatorView
UIActivityIndicatorView only.impl UIFocusItem for UIAlertView
UIAlertView only.impl UIFocusItem for UIBackgroundExtensionView
UIBackgroundExtensionView only.impl UIFocusItem for UIButton
UIButton only.impl UIFocusItem for UICalendarView
UICalendarView only.impl UIFocusItem for UICollectionReusableView
UICollectionViewCell only.impl UIFocusItem for UICollectionView
UICollectionView only.impl UIFocusItem for UICollectionViewCell
UICollectionViewCell only.impl UIFocusItem for UICollectionViewListCell
UICollectionViewListCell only.impl UIFocusItem for UIColorWell
UIColorWell only.impl UIFocusItem for UIControl
UIControl only.impl UIFocusItem for UIDatePicker
UIDatePicker only.impl UIFocusItem for UIEventAttributionView
UIEventAttributionView only.impl UIFocusItem for UIImageView
UIImageView only.impl UIFocusItem for UIInputView
UIInputView only.impl UIFocusItem for UILabel
UILabel only.impl UIFocusItem for UIListContentView
UIListContentConfiguration only.impl UIFocusItem for UIPageControl
UIPageControl only.impl UIFocusItem for UIPasteControl
UIPasteControl only.impl UIFocusItem for UIPickerView
UIPickerView only.impl UIFocusItem for UIPopoverBackgroundView
UIPopoverBackgroundView only.impl UIFocusItem for UIProgressView
UIProgressView only.impl UIFocusItem for UIRefreshControl
UIRefreshControl only.impl UIFocusItem for UIScrollView
UIScrollView only.impl UIFocusItem for UISearchBar
UISearchBar only.impl UIFocusItem for UISearchTextField
UISearchTextField only.impl UIFocusItem for UISegmentedControl
UISegmentedControl only.impl UIFocusItem for UISlider
UISlider only.impl UIFocusItem for UIStackView
UIStackView only.impl UIFocusItem for UIStandardTextCursorView
UIStandardTextCursorView only.impl UIFocusItem for UIStepper
UIStepper only.impl UIFocusItem for UISwitch
UISwitch only.impl UIFocusItem for UITabBar
UITabBar only.impl UIFocusItem for UITableView
UITableView only.impl UIFocusItem for UITableViewCell
UITableViewCell only.impl UIFocusItem for UITextField
UITextField only.impl UIFocusItem for UITextView
UITextView only.impl UIFocusItem for UIToolbar
UIToolbar only.impl UIFocusItem for UIView
UIView only.impl UIFocusItem for UIVisualEffectView
UIVisualEffectView only.impl UIFocusItem for UIWebView
UIWebView only.impl UIFocusItem for UIWindow
UIWindow only.