Contents

조회 수 1189 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

최상위 ViewController 가져오기

 

+ (UIViewController*)topMostViewController {
  UIViewController *topMostViewController = nil;

  UIViewController *rootViewController =
    [UIApplication sharedApplication].keyWindow.rootViewController;

  if ([rootViewController isKindOfClass:[UINavigationController class]]) {
    UINavigationController *navigationController = (UINavigationController *)rootViewController;
    topMostViewController = navigationController.visibleViewController;
  } else if (rootViewController.presentedViewController) {
    topMostViewController = rootViewController.presentedViewController;
  } else if ([rootViewController isKindOfClass:[UITabBarController class]]) {
    UITabBarController *tabBarController = (UITabBarController *)rootViewController;
    topMostViewController = tabBarController.selectedViewController;

    if ([topMostViewController isKindOfClass:[UINavigationController class]]) {
      UINavigationController *navigationController = (UINavigationController *)topMostViewController;
      topMostViewController = navigationController.visibleViewController;
    }
  } else {
    topMostViewController = rootViewController;
  }

  return topMostViewController;
}

 


?

  1. [js] Click button copy to clipboard

  2. [ios] 코코아 프로그래밍의 네이밍 룰(명명 규칙)

  3. [ppt] OCB기술개발팀 OJT 자료

  4. [ios] Objective-C Types & Storage Capacity

  5. GPL, AGPL, MPL,.. 한눈에 보는 오픈소스SW 라이선스

  6. [maven] Mac OS에 메이븐(maven) 설치하기

  7. [ios] UIView 계층구조

  8. [ios] FlckrFeed Example App (Swift)

  9. [ios] 최상위 ViewController 가져오기

  10. 맥에서 포트 확인하고 닫기 (mac)

  11. [ios] 동영상 플레이어 샘플 (for Local File)

  12. RSVP 란?

Board Pagination Prev 1 ... 82 83 84 85 86 87 88 89 90 91 ... 98 Next
/ 98