iOS UIViewController lifecycle

운영 체제: macOS Monterey 12.5
사용 버전: Xcode 13.4.1, Swift, UIKit, Storyboard

iOS UIViewController lifecycle을 알아보겠습니다.


UIKit은 기본적으로 UIViewController를 사용합니다. 이 컨트롤러는 생명 주기가 있습니다. 이 주기에 따라 동작하는 것을 만들 수 있는데요. 애플에서는 아래와 같은 사진을 제공합니다.

출처: https://developer.apple.com/documentation/uikit/uiviewcontroller





직접 실행해서 확인해 봅시다.

아래와 같이 각 부분마다 print 문을 적어줍니다.







실행해 봅시다.













View did load

View will appear

View did appear

View will disapear

View did disapear

순입니다.



끝.


카테고리: iOS

댓글

이 블로그의 인기 게시물

Python urllib.parse.quote()

KiCad 시작하기 4 (기존 회로도 수정 및 추가)

Forensics .pyc 파일 .py로 복구하기

KiCad 시작하기 1 (회로도 만들기)

KiCad 시작하기 3 (새로운 소자 추가하기)

Kivy 시작하기 12 (Pyinstaller로 exe 파일 만들기)

딩기 요트 명칭

Android Notification with Full Screen

iOS Swift callAsFunction

Android Room database FTS