Develop
2015.10.12 14:45
[ios] 최상위 ViewController 가져오기
조회 수 1067 댓글 0
최상위 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; }
-
[android] 딜레이를 구현하기 위한 꼼수
-
[android] How can I place app icon on launcher home screen?
-
[android] Calling activity function from separate class
-
[Android Error] The number of method references in a .dex file cannot exceed 64K
-
[android] 레이아웃 사이즈 변경 (동적; programmatically)
-
[android] 초간단 얼럿 (AlertDialog)
-
[android] dp, px 서로 변환
-
[matlab] ZigZag-Scanning (2-D Array)
-
[matlab] 정보은닉 스테가노그래피(Steganography) 수업
-
[c] RSA 암호화 구현(gmp 라이브러리 활용)
-
[c] Mac OS 에 gmp(gmp.h) 라이브러리 설치
-
[c] 셀프 넘버(Self Number) 구하기