Contents

조회 수 1770 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

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

단축키

Prev이전 문서

Next다음 문서

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

최상위 ViewController 가져오기

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
+ (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;
}

 


?

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
1009 Develop [ios] How To Use UIScrollView to Scroll and Zoom Content (Using Objective-C) file hooni 2016.03.23 2870
1008 Develop [js] AngularJS 란? file hooni 2015.11.26 1682
1007 PPT [ppt] OCB기술개발팀 OJT 자료 file hooni 2015.11.13 2081
1006 Develop [php] 한글 문자열 자르기 (utf-8) hooni 2015.11.10 2164
1005 Develop [c] 한글 문자열 출력 hooni 2015.11.10 2469
1004 Develop [ios] NavigationController 에서 왼쪽(back) 버튼 후킹하기 hooni 2015.10.23 2843
1003 Develop [ios] ViewController Push할 때 애니메이션 효과 hooni 2015.10.23 1646
1002 Develop [linux] CentOS Apache 웹서버에 HTTPS 적용 hooni 2015.10.23 1626
1001 Etc [eng] 숙제 ㅋㅋㅋ secret hooni 2015.10.14 1
1000 Develop [c] 기막힌 정렬 코드 ㅋㄷ file hooni 2015.10.13 1671
999 Develop [ios] 상위 ViewController 가져오기 hooni 2015.10.12 1924
» Develop [ios] 최상위 ViewController 가져오기 hooni 2015.10.12 1770
Board Pagination Prev 1 ... 10 11 12 13 14 15 16 17 18 19 ... 99 Next
/ 99

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

나눔고딕 사이트로 가기

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5