조회 수 1189 추천 수 0 댓글 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. [ios][swift] 초간단 To-do Memo

  2. RSVP 란?

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

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

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

  6. [ios] FlckrFeed Example App (Swift)

  7. [ios] UIView 계층구조

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

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

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

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

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

  13. [js] Click button copy to clipboard

  14. [coding] Find all anagrams in a string

  15. [ios] NavigationController 에서 왼쪽(back) 버튼 후킹하기

  16. [ios] Facebook SDK 로그인 설명

Board Pagination Prev 1 ... 7 8 9 10 11 ... 74 Next
/ 74