UIFocusEnvironment

Trait UIFocusEnvironment 

Source
pub unsafe trait UIFocusEnvironment: NSObjectProtocol + MainThreadOnly {
    // Provided methods
    unsafe fn preferredFocusEnvironments(
        &self,
    ) -> Retained<NSArray<ProtocolObject<dyn UIFocusEnvironment>>>
       where Self: Sized + Message { ... }
    unsafe fn parentFocusEnvironment(
        &self,
    ) -> Option<Retained<ProtocolObject<dyn UIFocusEnvironment>>>
       where Self: Sized + Message { ... }
    unsafe fn focusItemContainer(
        &self,
    ) -> Option<Retained<ProtocolObject<dyn UIFocusItemContainer>>>
       where Self: Sized + Message { ... }
    unsafe fn setNeedsFocusUpdate(&self)
       where Self: Sized + Message { ... }
    unsafe fn updateFocusIfNeeded(&self)
       where Self: Sized + Message { ... }
    unsafe fn shouldUpdateFocusInContext(
        &self,
        context: &UIFocusUpdateContext,
    ) -> bool
       where Self: Sized + Message { ... }
    unsafe fn didUpdateFocusInContext_withAnimationCoordinator(
        &self,
        context: &UIFocusUpdateContext,
        coordinator: &UIFocusAnimationCoordinator,
    )
       where Self: Sized + Message { ... }
    unsafe fn soundIdentifierForFocusUpdateInContext(
        &self,
        context: &UIFocusUpdateContext,
    ) -> Option<Retained<UIFocusSoundIdentifier>>
       where Self: Sized + Message { ... }
    unsafe fn preferredFocusedView(&self) -> Option<Retained<UIView>>
       where Self: Sized + Message { ... }
    unsafe fn focusGroupIdentifier(&self) -> Option<Retained<NSString>>
       where Self: Sized + Message { ... }
}
Available on crate feature UIFocus only.
Expand description

Objects conforming to UIFocusEnvironment influence and respond to focus behavior within a specific area of the screen that they control.

See also Apple’s documentation

Provided Methods§

Source

unsafe fn preferredFocusEnvironments( &self, ) -> Retained<NSArray<ProtocolObject<dyn UIFocusEnvironment>>>
where Self: Sized + Message,

The preferred focus environments define where to search for the default focused item in an environment, such as when focus updates programmatically. Starting from the target environment, each preferred focus environment is recursively searched in the order of the array until an eligible, focusable item is found. Preferred focus environments can include focusable and non-focusable items, in addition to non-item environments. Returning an empty array is equivalent to returning an array containing only ‘self’.

Source

unsafe fn parentFocusEnvironment( &self, ) -> Option<Retained<ProtocolObject<dyn UIFocusEnvironment>>>
where Self: Sized + Message,

The parent focus environment of this environment, or nil if no parent exists. NOTE: If you implement this method, you must return a non-nil value for parent focus environment, otherwise your focus environment will not participate in focus interactions.

Source

unsafe fn focusItemContainer( &self, ) -> Option<Retained<ProtocolObject<dyn UIFocusItemContainer>>>
where Self: Sized + Message,

The container of any child focus items in this focus environment, or nil if no container exists.

Source

unsafe fn setNeedsFocusUpdate(&self)
where Self: Sized + Message,

Marks this environment as needing a focus update, which if accepted will attempt to reset focus to this environment, or one of its preferred focus environments, on the next update cycle. If this environment does not currently contain the focused item, then calling this method has no effect. If a parent of this environment is also requesting focus, then this environment’s request is rejected in favor of the parent’s. NOTE: If you provide your own implementation, it must call [[UIFocusSystem focusSystemForEnvironment:self] requestFocusUpdateToEnvironment:self];

Source

unsafe fn updateFocusIfNeeded(&self)
where Self: Sized + Message,

Forces focus to be updated immediately. If there is an environment that has requested a focus update via -setNeedsFocusUpdate, and the request was accepted, then focus will be updated to that environment or one of its preferred focus environments. NOTE: If you provide your own implementation, it must call [[UIFocusSystem focusSystemForEnvironment:self] updateFocusIfNeeded];.

Source

unsafe fn shouldUpdateFocusInContext( &self, context: &UIFocusUpdateContext, ) -> bool
where Self: Sized + Message,

Asks whether the system should allow a focus update to occur.

Source

unsafe fn didUpdateFocusInContext_withAnimationCoordinator( &self, context: &UIFocusUpdateContext, coordinator: &UIFocusAnimationCoordinator, )
where Self: Sized + Message,

Available on crate feature UIFocusAnimationCoordinator only.

Called when the screen’s focused item has been updated to a new item. Use the animation coordinator to schedule focus-related animations in response to the update.

Source

unsafe fn soundIdentifierForFocusUpdateInContext( &self, context: &UIFocusUpdateContext, ) -> Option<Retained<UIFocusSoundIdentifier>>
where Self: Sized + Message,

Specifies an identifier corresponding to a sound that should be played for a focus update. Return UIFocusSoundIdentifierNone to opt out of sounds, UIFocusSoundIdentifierDefault for the system default sounds, a previously registered identifier for a custom sound, or nil to defer the decision to the parent.

Source

unsafe fn preferredFocusedView(&self) -> Option<Retained<UIView>>
where Self: Sized + Message,

👎Deprecated
Available on crate features UIResponder and UIView only.
Source

unsafe fn focusGroupIdentifier(&self) -> Option<Retained<NSString>>
where Self: Sized + Message,

The identifier of the focus group that this view belongs to. If this is nil, subviews inherit their superview’s focus group.

Trait Implementations§

Source§

impl ProtocolType for dyn UIFocusEnvironment

Source§

const NAME: &'static str = "UIFocusEnvironment"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn UIFocusEnvironment

Implementations on Foreign Types§

Source§

impl<T> UIFocusEnvironment for ProtocolObject<T>

Implementors§

Source§

impl UIFocusEnvironment for UIActionSheet

Available on crate feature UIActionSheet only.
Source§

impl UIFocusEnvironment for UIActivityIndicatorView

Available on crate feature UIActivityIndicatorView only.
Source§

impl UIFocusEnvironment for UIActivityViewController

Available on crate feature UIActivityViewController only.
Source§

impl UIFocusEnvironment for UIAlertController

Available on crate feature UIAlertController only.
Source§

impl UIFocusEnvironment for UIAlertView

Available on crate feature UIAlertView only.
Source§

impl UIFocusEnvironment for UIButton

Available on crate feature UIButton only.
Source§

impl UIFocusEnvironment for UICalendarView

Available on crate feature UICalendarView only.
Source§

impl UIFocusEnvironment for UICloudSharingController

Available on crate feature UICloudSharingController only.
Source§

impl UIFocusEnvironment for UICollectionReusableView

Available on crate feature UICollectionViewCell only.
Source§

impl UIFocusEnvironment for UICollectionView

Available on crate feature UICollectionView only.
Source§

impl UIFocusEnvironment for UICollectionViewCell

Available on crate feature UICollectionViewCell only.
Source§

impl UIFocusEnvironment for UICollectionViewController

Available on crate feature UICollectionViewController only.
Source§

impl UIFocusEnvironment for UICollectionViewListCell

Available on crate feature UICollectionViewListCell only.
Source§

impl UIFocusEnvironment for UIColorPickerViewController

Available on crate feature UIColorPickerViewController only.
Source§

impl UIFocusEnvironment for UIColorWell

Available on crate feature UIColorWell only.
Source§

impl UIFocusEnvironment for UIContentUnavailableView

Available on crate feature UIContentUnavailableView only.
Source§

impl UIFocusEnvironment for UIControl

Available on crate feature UIControl only.
Source§

impl UIFocusEnvironment for UIDatePicker

Available on crate feature UIDatePicker only.
Source§

impl UIFocusEnvironment for UIDocumentBrowserViewController

Available on crate feature UIDocumentBrowserViewController only.
Source§

impl UIFocusEnvironment for UIDocumentMenuViewController

Available on crate feature UIDocumentMenuViewController only.
Source§

impl UIFocusEnvironment for UIDocumentPickerExtensionViewController

Available on crate feature UIDocumentPickerExtensionViewController only.
Source§

impl UIFocusEnvironment for UIDocumentPickerViewController

Available on crate feature UIDocumentPickerViewController only.
Source§

impl UIFocusEnvironment for UIDocumentViewController

Available on crate feature UIDocumentViewController only.
Source§

impl UIFocusEnvironment for UIEventAttributionView

Available on crate feature UIEventAttributionView only.
Source§

impl UIFocusEnvironment for UIFontPickerViewController

Available on crate feature UIFontPickerViewController only.
Source§

impl UIFocusEnvironment for UIImagePickerController

Available on crate feature UIImagePickerController only.
Source§

impl UIFocusEnvironment for UIImageView

Available on crate feature UIImageView only.
Source§

impl UIFocusEnvironment for UIInputView

Available on crate feature UIInputView only.
Source§

impl UIFocusEnvironment for UIInputViewController

Available on crate feature UIInputViewController only.
Source§

impl UIFocusEnvironment for UILabel

Available on crate feature UILabel only.
Source§

impl UIFocusEnvironment for UIListContentView

Available on crate feature UIListContentConfiguration only.
Source§

impl UIFocusEnvironment for UINavigationBar

Available on crate feature UINavigationBar only.
Source§

impl UIFocusEnvironment for UINavigationController

Available on crate feature UINavigationController only.
Source§

impl UIFocusEnvironment for UIPageControl

Available on crate feature UIPageControl only.
Source§

impl UIFocusEnvironment for UIPageViewController

Available on crate feature UIPageViewController only.
Source§

impl UIFocusEnvironment for UIPasteControl

Available on crate feature UIPasteControl only.
Source§

impl UIFocusEnvironment for UIPickerView

Available on crate feature UIPickerView only.
Source§

impl UIFocusEnvironment for UIPopoverBackgroundView

Available on crate feature UIPopoverBackgroundView only.
Source§

impl UIFocusEnvironment for UIPopoverPresentationController

Available on crate feature UIPopoverPresentationController only.
Source§

impl UIFocusEnvironment for UIPresentationController

Available on crate feature UIPresentationController only.
Source§

impl UIFocusEnvironment for UIProgressView

Available on crate feature UIProgressView only.
Source§

impl UIFocusEnvironment for UIReferenceLibraryViewController

Available on crate feature UIReferenceLibraryViewController only.
Source§

impl UIFocusEnvironment for UIRefreshControl

Available on crate feature UIRefreshControl only.
Source§

impl UIFocusEnvironment for UIScrollView

Available on crate feature UIScrollView only.
Source§

impl UIFocusEnvironment for UISearchBar

Available on crate feature UISearchBar only.
Source§

impl UIFocusEnvironment for UISearchContainerViewController

Available on crate feature UISearchContainerViewController only.
Source§

impl UIFocusEnvironment for UISearchController

Available on crate feature UISearchController only.
Source§

impl UIFocusEnvironment for UISearchTextField

Available on crate feature UISearchTextField only.
Source§

impl UIFocusEnvironment for UISegmentedControl

Available on crate feature UISegmentedControl only.
Source§

impl UIFocusEnvironment for UISheetPresentationController

Available on crate feature UISheetPresentationController only.
Source§

impl UIFocusEnvironment for UISlider

Available on crate feature UISlider only.
Source§

impl UIFocusEnvironment for UISplitViewController

Available on crate feature UISplitViewController only.
Source§

impl UIFocusEnvironment for UIStackView

Available on crate feature UIStackView only.
Source§

impl UIFocusEnvironment for UIStandardTextCursorView

Available on crate feature UIStandardTextCursorView only.
Source§

impl UIFocusEnvironment for UIStepper

Available on crate feature UIStepper only.
Source§

impl UIFocusEnvironment for UISwitch

Available on crate feature UISwitch only.
Source§

impl UIFocusEnvironment for UITabBar

Available on crate feature UITabBar only.
Source§

impl UIFocusEnvironment for UITabBarController

Available on crate feature UITabBarController only.
Source§

impl UIFocusEnvironment for UITableView

Available on crate feature UITableView only.
Source§

impl UIFocusEnvironment for UITableViewCell

Available on crate feature UITableViewCell only.
Source§

impl UIFocusEnvironment for UITableViewController

Available on crate feature UITableViewController only.
Source§

impl UIFocusEnvironment for UITableViewHeaderFooterView

Available on crate feature UITableViewHeaderFooterView only.
Source§

impl UIFocusEnvironment for UITextField

Available on crate feature UITextField only.
Source§

impl UIFocusEnvironment for UITextFormattingViewController

Available on crate feature UITextFormattingViewController only.
Source§

impl UIFocusEnvironment for UITextView

Available on crate feature UITextView only.
Source§

impl UIFocusEnvironment for UIToolbar

Available on crate feature UIToolbar only.
Source§

impl UIFocusEnvironment for UIVideoEditorController

Available on crate feature UIVideoEditorController only.
Source§

impl UIFocusEnvironment for UIView

Available on crate feature UIView only.
Source§

impl UIFocusEnvironment for UIViewController

Available on crate feature UIViewController only.
Source§

impl UIFocusEnvironment for UIVisualEffectView

Available on crate feature UIVisualEffectView only.
Source§

impl UIFocusEnvironment for UIWebView

Available on crate feature UIWebView only.
Source§

impl UIFocusEnvironment for UIWindow

Available on crate feature UIWindow only.