안내 액세스를 감지하거나 반응 하시겠습니까?
-
11-12-2019 - |
문제
앱에서 생성중인 앱을 구성하기 위해 추가 화면을 추가하여 앱을 구성해야합니다.
앱의 여는 화면에 추가 버튼을 추가 할 수 있습니다. iPad가 안내가없는 경우에만 표시됩니다.
는 장치가 현재 가이드 액세스로 실행 중이고 활성화되거나 비활성화 된 것에 반응하는 것을 감지 할 수 있습니까?
해결책
다음과 같은 것을 원합니다 :
NSLog(@"Accessabilitiy enabled: %@", UIAccessibilityIsGuidedAccessEnabled() ? @"YES" : @"NO");
if (!UIAccessibilityIsGuidedAccessEnabled()) {
// show something since I'm not in guided access
}
.
변경시 알고 싶다면 ...
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(guidedAccessChanged) name:UIAccessibilityGuidedAccessStatusDidChangeNotification object:nil];
.
다음 첫 번째 테스트에 따라 켜져 있거나 꺼져 있는지 확인하십시오.
다른 팁
WWDC 2013에서 깊이가있는 안내 액세스 에서 시작 : 26)
가이드 액세스가 활성화 된지 확인 (iOS 6+) : < / P>
UIAccessibilityIsGuidedAccessEnabled()
.
가이드 액세스 상태 변경에 응답 (iOS 6+) :
UIAccessibilityGuidedAccessStatusDidChangeNotification
.
가이드 액세스 모드에서 사용자 지정 제한을 추가 (iOS 7+) : < / P>
UIGuidedAccessRestrictionDelegate
.
지정된 제한에 대한 제한 상태 가져 오기 (iOS 7+) :
스위프트 :
func UIGuidedAccessRestrictionStateForIdentifier(_ restrictionIdentifier: String) -> UIGuidedAccessRestrictionState
.
obj-c
UIGuidedAccessRestrictionState UIGuidedAccessRestrictionStateForIdentifier(NSString *restrictionIdentifier);
. swift 4.2 :
if !UIAccessibility.isGuidedAccessEnabled {
// show something since I'm not in guided access
}
. 제휴하지 않습니다 StackOverflow