Notice
Recent Posts
Recent Comments
Link
투케이2K
144. (Objective-C/objc) [iOS 17] 상태 바 사이즈 확인 대응 - statusBarFrame Use the statusBarManager 본문
Objective-C
144. (Objective-C/objc) [iOS 17] 상태 바 사이즈 확인 대응 - statusBarFrame Use the statusBarManager
투케이2K 2024. 4. 14. 10:24[개발 환경 설정]
개발 툴 : XCODE
개발 언어 : OBJECTIVE-C

[소스 코드]
// [try catch 구문 정의 실시]
@try {
// ---------------------------------------------
// [로직 처리 실시]
// ---------------------------------------------
//*
dispatch_async(dispatch_get_main_queue(), ^{
UIWindow *window = [[[UIApplication sharedApplication] windows] objectAtIndex:0];
CGFloat height = window.windowScene.statusBarManager.statusBarFrame.size.height;
[S_Log _D_WithC_:[NSString stringWithFormat:@"%s", __FILE__]
M_:[NSString stringWithFormat:@"%s :: %d", __FUNCTION__, __LINE__]
description:@"상태창 height 크기 확인" data:[NSArray arrayWithObjects:
[NSString stringWithFormat:@"height :: %f", height],
nil]];
});
// */
// ---------------------------------------------
}
@catch (NSException *exception) {
NSLog(@"\n[NSException : 예외 상황 발생] : %s\n", exception.description.UTF8String);
}
[결과 출력]

반응형
'Objective-C' 카테고리의 다른 글
Comments