Package apple.uikit.protocol
Interface UIFocusEnvironment
-
- All Known Subinterfaces:
UIFocusItem
- All Known Implementing Classes:
ABNewPersonViewController,ABPeoplePickerNavigationController,ABPersonViewController,ABUnknownPersonViewController,ADBannerView,ADInterstitialAdPresentationViewController,ARCoachingOverlayView,ARSCNView,ARSKView,ASAccountAuthenticationModificationViewController,ASAuthorizationAppleIDButton,ASCredentialProviderViewController,AUViewController,AVPlayerViewController,AVRoutePickerView,BCChatButton,CABTMIDICentralViewController,CABTMIDILocalPeripheralViewController,CAInterAppAudioSwitcherView,CAInterAppAudioTransportView,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,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,PKPaymentAuthorizationViewController,PKPaymentButton,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,TWTweetComposeViewController,UIActionSheet,UIActivityIndicatorView,UIActivityViewController,UIAlertController,UIAlertView,UIButton,UICloudSharingController,UICollectionReusableView,UICollectionView,UICollectionViewCell,UICollectionViewController,UICollectionViewListCell,UIColorPickerViewController,UIColorWell,UIControl,UIDatePicker,UIDocumentBrowserViewController,UIDocumentMenuViewController,UIDocumentPickerExtensionViewController,UIDocumentPickerViewController,UIFontPickerViewController,UIImagePickerController,UIImageView,UIInputView,UIInputViewController,UILabel,UIListContentView,UINavigationBar,UINavigationController,UIPageControl,UIPageViewController,UIPickerView,UIPopoverBackgroundView,UIPopoverPresentationController,UIPresentationController,UIProgressView,UIReferenceLibraryViewController,UIRefreshControl,UIScrollView,UISearchBar,UISearchContainerViewController,UISearchController,UISearchTextField,UISegmentedControl,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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voiddidUpdateFocusInContextWithAnimationCoordinator(UIFocusUpdateContext context, UIFocusAnimationCoordinator coordinator)Called when the screen’s focused item has been updated to a new item.default java.lang.StringfocusGroupIdentifier()The identifier of the focus group that this view belongs to.UIFocusItemContainerfocusItemContainer()The container of any child focus items in this focus environment, or nil if no container exists.UIFocusEnvironmentparentFocusEnvironment()The parent focus environment of this environment, or nil if no parent exists.default UIViewpreferredFocusedView()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(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(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.
-
-