#if USE_UIKIT_PUBLIC_HEADERS || !__has_include(<UIKitCore/UIFocusSystem.h>)
//
// UIFocusSystem.h
// UIKit
//
// Copyright © 2016-2018 Apple Inc. All rights reserved.
//
#import <UIKit/UIFocus.h>
NS_ASSUME_NONNULL_BEGIN
#pragma mark - 焦点配置 Class
#pragma mark -
NS_CLASS_AVAILABLE_IOS(11_0) @interface UIFocusSystem : NSObject
/// 当前关注的项目
@property (nonatomic, weak, readonly, nullable) id<UIFocusItem> focusedItem API_AVAILABLE(tvos(12.0), ios(12.0));
#pragma mark |实例化|
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
// 指定环境包含的焦点的配置
+ (nullable UIFocusSystem *)focusSystemForEnvironment:(id<UIFocusEnvironment>)environment API_AVAILABLE(tvos(12.0), ios(12.0));
// 对指定环境进行焦点更新(如果接受,焦点更新将在下一个运行循环周期中进行)
- (void)requestFocusUpdateToEnvironment:(id<UIFocusEnvironment>)environment API_AVAILABLE(tvos(12.0), ios(12.0));
// 立即更新任何待定焦点
- (void)updateFocusIfNeeded API_AVAILABLE(tvos(12.0), ios(12.0));
// 两个焦点环境是否具有继承关系 (environment焦点环境是否包含otherEnvironment焦点环境)
+ (BOOL)environment:(id<UIFocusEnvironment>)environment containsEnvironment:(id<UIFocusEnvironment>)otherEnvironment;
// 把指定声音注册成焦点声音,并设置对应的焦点声音标识符
+ (void)registerURL:(NSURL *)soundFileURL forSoundIdentifier:(UIFocusSoundIdentifier)identifier API_AVAILABLE(tvos(11.0)) API_UNAVAILABLE(ios, watchos);
@end
NS_ASSUME_NONNULL_END
#else
#import <UIKitCore/UIFocusSystem.h>
#endif
网友评论