본문 바로가기 메뉴 바로가기

iOS 개발 이야기

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

iOS 개발 이야기

검색하기 폼
  • 분류 전체보기 (6)
    • iOS (6)
      • UIApplication (3)
      • UITextField (1)
      • Extension (1)
      • WKWebView (1)
  • 방명록

appDelegate (1)
iOS 최상위 뷰컨트롤러 확인하기 (presentedViewController)

개발하다 보면 뷰컨트롤러가 아닌 AppDelegate나 NSObject 클래스에서 UIAlertController를 띄우고 싶을때가 종종 있다. UIAlertController를 사용할려면 뷰컨트롤러에서 present를 해야하고 최상위가 아닌 뷰컨트롤러에서 시도할 경우 아래와 같이 계층 에러가 발생한다.(참고: viewDidLoad에서 바로 다른 뷰컨트롤러를 present를 하게 될 경우도 발생한다. 화면이 다 보여지지 않은 상태에서 다른 뷰컨트롤러를 보여준다는게 말이 안되기 때문이다.) Warning: Attempt to present on whose view is not in the window hierarchy! 그래서 아래와 같이 최상위 뷰컨트롤러를 구하는 클래스 함수를 만들어서 사용하고 있다. ..

iOS/UIApplication 2017. 8. 2. 17:05
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • 이미지 푸시
  • UITextFieldTextDidChange
  • shouldChangeCharactersIn
  • Notification Service Extension
  • 인증 키
  • WebSiteDataStore
  • NotificationCenter
  • UITextFieldDelegate
  • UITextFiled
  • whose view is not in the window hierarchy
  • apns
  • UNUserNotificationCenter
  • ios
  • Easy APNs Provider
  • presentedViewController
  • iOS10
  • 리치 푸시
  • setAlternateIconName
  • 앱 아이콘
  • wkwebview
  • Create a New Key
  • iOS Keys
  • swift3
  • UNUserNotificationCenterDelegate
  • mutable-content
  • swift
  • AppIcon
  • appDelegate
  • httpCookieStore
  • UIApplication
more
«   2025/05   »
일 월 화 수 목 금 토
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
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바