暂无描述

ASScreenSafeManager.m 683B

1234567891011121314151617181920212223242526272829
  1. //
  2. // ASScreenSafeManager.m
  3. // ACSION
  4. //
  5. // Created by sunyue on 2019/4/22.
  6. // Copyright © 2019 acsion. All rights reserved.
  7. //
  8. #import "ASScreenSafeManager.h"
  9. @implementation ASScreenSafeManager
  10. + (CGFloat)statusBarHeightOfScreen {
  11. return [UIApplication sharedApplication].statusBarFrame.size.height;
  12. }
  13. + (CGFloat)navBarHeightOfScreen {
  14. return [self statusBarHeightOfScreen] + 44;
  15. }
  16. + (CGFloat)safeBottomHeightOfScreen {
  17. if (@available(iOS 11.0, *)) {
  18. return [UIApplication sharedApplication].keyWindow.safeAreaInsets.bottom;
  19. } else {
  20. return 0;
  21. }
  22. }
  23. + (CGFloat)tabBarHeightOfScreen {
  24. return [self safeBottomHeightOfScreen] + 49;
  25. }
  26. @end