Interface UIFocusEnvironment

    • Method Detail

      • didUpdateFocusInContextWithAnimationCoordinator

        void didUpdateFocusInContextWithAnimationCoordinator​(UIFocusUpdateContext context,
                                                             UIFocusAnimationCoordinator coordinator)
        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.
      • preferredFocusEnvironments

        NSArray<?> preferredFocusEnvironments()
        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'.
      • preferredFocusedView

        default UIView preferredFocusedView()
      • setNeedsFocusUpdate

        void setNeedsFocusUpdate()
        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]`;
      • shouldUpdateFocusInContext

        boolean shouldUpdateFocusInContext​(UIFocusUpdateContext context)
        Asks whether the system should allow a focus update to occur.
      • updateFocusIfNeeded

        void updateFocusIfNeeded()
        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];`.
      • focusItemContainer

        UIFocusItemContainer focusItemContainer()
        The container of any child focus items in this focus environment, or nil if no container exists.
      • parentFocusEnvironment

        UIFocusEnvironment parentFocusEnvironment()
        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.
      • focusGroupIdentifier

        default java.lang.String focusGroupIdentifier()
        The identifier of the focus group that this view belongs to. If this is nil, subviews inherit their superview's focus group.