Package apple.uikit.protocol
Interface UIFocusEnvironment
-
- All Known Subinterfaces:
UIFocusItem
- All Known Implementing Classes:
ABNewPersonViewController,ABPeoplePickerNavigationController,ABPersonViewController,ABUnknownPersonViewController,ARCoachingOverlayView,ARSCNView,ARSKView,ASAccountAuthenticationModificationViewController,ASAuthorizationAppleIDButton,ASCredentialProviderViewController,AUGenericViewController,AUViewController,AVPictureInPictureVideoCallViewController,AVPlayerViewController,AVRoutePickerView,BCChatButton,CABTMIDICentralViewController,CABTMIDILocalPeripheralViewController,CAInterAppAudioSwitcherView,CAInterAppAudioTransportView,CLLocationButton,CNContactPickerViewController,CNContactViewController,CPWindow,EKCalendarChooser,EKEventEditViewController,EKEventViewController,FPUIActionExtensionViewController,GCEventViewController,GKAchievementViewController,GKFriendRequestComposeViewController,GKGameCenterViewController,GKLeaderboardViewController,GKMatchmakerViewController,GKTurnBasedMatchmakerViewController,GLKView,GLKViewController,HKActivityRingView,HMCameraView,ILClassificationUIExtensionViewController,INUIAddVoiceShortcutButton,INUIAddVoiceShortcutViewController,INUIEditVoiceShortcutViewController,LPLinkView,MCBrowserViewController,MFMailComposeViewController,MFMessageComposeViewController,MKAnnotationView,MKCircleView,MKCompassButton,MKLookAroundViewController,MKMapView,MKMarkerAnnotationView,MKOverlayPathView,MKOverlayView,MKPinAnnotationView,MKPolygonView,MKPolylineView,MKScaleView,MKUserLocationView,MKUserTrackingButton,MPMediaPickerController,MPMoviePlayerViewController,MPVolumeView,MSMessagesAppViewController,MSStickerBrowserView,MSStickerBrowserViewController,MSStickerView,MTKView,PDFThumbnailView,PDFView,PHLivePhotoView,PHPickerViewController,PKAddPassButton,PKAddPassesViewController,PKAddPaymentPassViewController,PKAddSecureElementPassViewController,PKCanvasView,PKIdentityButton,PKPayLaterView,PKPaymentAuthorizationViewController,PKPaymentButton,PKShareSecureElementPassViewController,QLPreviewController,RPBroadcastActivityViewController,RPPreviewViewController,RPSystemBroadcastPickerView,SCNNode,SCNReferenceNode,SCNView,SFSafariViewController,SK3DNode,SKAudioNode,SKCameraNode,SKCloudServiceSetupViewController,SKCropNode,SKEffectNode,SKEmitterNode,SKFieldNode,SKLabelNode,SKLightNode,SKNode,SKReferenceNode,SKScene,SKShapeNode,SKSpriteNode,SKStoreProductViewController,SKTileMapNode,SKTransformNode,SKVideoNode,SKView,SLComposeServiceViewController,SLComposeViewController,STWebpageController,SWAttributionView,SWCollaborationView,SWRemoveParticipantAlertController,TWTweetComposeViewController,UIActionSheet,UIActivityIndicatorView,UIActivityViewController,UIAlertController,UIAlertView,UIButton,UICalendarView,UICloudSharingController,UICollectionReusableView,UICollectionView,UICollectionViewCell,UICollectionViewController,UICollectionViewListCell,UIColorPickerViewController,UIColorWell,UIContentUnavailableView,UIControl,UIDatePicker,UIDocumentBrowserViewController,UIDocumentMenuViewController,UIDocumentPickerExtensionViewController,UIDocumentPickerViewController,UIDocumentViewController,UIEventAttributionView,UIFontPickerViewController,UIImagePickerController,UIImageView,UIInputView,UIInputViewController,UILabel,UIListContentView,UINavigationBar,UINavigationController,UIPageControl,UIPageViewController,UIPasteControl,UIPickerView,UIPopoverBackgroundView,UIPopoverPresentationController,UIPresentationController,UIProgressView,UIReferenceLibraryViewController,UIRefreshControl,UIScrollView,UISearchBar,UISearchContainerViewController,UISearchController,UISearchTextField,UISegmentedControl,UISheetPresentationController,UISlider,UISplitViewController,UIStackView,UIStepper,UISwitch,UITabBar,UITabBarController,UITableView,UITableViewCell,UITableViewController,UITableViewHeaderFooterView,UITextField,UITextView,UIToolbar,UIVideoEditorController,UIView,UIViewController,UIVisualEffectView,UIWebView,UIWindow,VNDocumentCameraViewController,WKWebView
public interface UIFocusEnvironmentObjects conforming to UIFocusEnvironment influence and respond to focus behavior within a specific area of the screen that they control. API-Since: 9.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description voiddidUpdateFocusInContextWithAnimationCoordinator(@NotNull UIFocusUpdateContext context, @NotNull UIFocusAnimationCoordinator coordinator)Called when the screen’s focused item has been updated to a new item.default @Nullable java.lang.StringfocusGroupIdentifier()The identifier of the focus group that this view belongs to.@Nullable UIFocusItemContainerfocusItemContainer()The container of any child focus items in this focus environment, or nil if no container exists.@Nullable UIFocusEnvironmentparentFocusEnvironment()The parent focus environment of this environment, or nil if no parent exists.default @Nullable UIViewpreferredFocusedView()Deprecated.@NotNull NSArray<?>preferredFocusEnvironments()The preferred focus environments define where to search for the default focused item in an environment, such as when focus updates programmatically.voidsetNeedsFocusUpdate()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.booleanshouldUpdateFocusInContext(@NotNull UIFocusUpdateContext context)Asks whether the system should allow a focus update to occur.voidupdateFocusIfNeeded()Forces focus to be updated immediately.
-
-
-
Method Detail
-
didUpdateFocusInContextWithAnimationCoordinator
void didUpdateFocusInContextWithAnimationCoordinator(@NotNull @NotNull UIFocusUpdateContext context, @NotNull @NotNull 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
@NotNull @NotNull 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
@Nullable @Deprecated default @Nullable UIView preferredFocusedView()
Deprecated.API-Since: 9.0 Deprecated-Since: 10.0
-
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(@NotNull @NotNull 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
@Nullable @Nullable UIFocusItemContainer focusItemContainer()
The container of any child focus items in this focus environment, or nil if no container exists. API-Since: 12.0
-
parentFocusEnvironment
@Nullable @Nullable 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. API-Since: 12.0
-
focusGroupIdentifier
@Nullable default @Nullable 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. API-Since: 14.0
-
-