티스토리 뷰
아이폰 개발을 하다보면, 최고 위로 올라와 있는 녀석을 확인하여 볼 경우가 있습니다.
안드로이드 같은 경우에는 Activity를 확ㅇ니하여 보겠지만.
아이폰은 다음과 같이 확인합니다.
+ (UIViewController *)topViewController:(UIViewController *)rootViewController {
if (rootViewController.presentedViewController == nil) {
return rootViewController;
}
if ([rootViewController.presentedViewController isKindOfClass:[UINavigationController class]]) {
UINavigationController *navigationController = (UINavigationController *)rootViewController.presentedViewController;
UIViewController *lastViewController = [[navigationController viewControllers] lastObject];
return [self topViewController:lastViewController];
}
UIViewController *presentedViewController = (UIViewController *)rootViewController.presentedViewController;
return [self topViewController:presentedViewController];
}
안되면 돌던지지는 마세요 ㅠㅠ
'Mobile > iOS' 카테고리의 다른 글
| [iOS]View가 Load 될 경우 (1) | 2016.01.19 |
|---|---|
| [iOS]Nib 불러와서 사용하기 (0) | 2016.01.19 |
| [iOS]지역화 (0) | 2015.10.27 |
| [iOS]소스에서 segue 호출 (0) | 2015.07.16 |
| [iOS]segue호출시 값 전달하기 (0) | 2015.07.16 |
- Total
- Today
- Yesterday
- golang
- Codable
- ios
- Java
- Python
- centos8
- Xcode
- Gradle
- github
- Spring
- intellij
- windows10
- Windows
- Kotlin
- go
- rxswift
- docker
- MySQL
- ubuntu
- php
- android
- SWIFT
- war
- enum
- git
- Linux
- CentOS
- cocoapods
- nodejs
- tomcat
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 26 | 27 | 28 | 29 | 30 | 31 |