🖥️
iOS App with Pop
Swift 4
Swift 4
  • iOS App development
  • Create New Project
  • Introduction to Xcode
  • App's life cycle
  • UIViewController
  • Storyboard
  • First Run
  • Display todo list
  • Basic Auto Layout
  • MVC
  • Model
  • Binding TableView
  • Binding TableViewCell
  • TableViewDelegate
  • Add navigationBar with + button
  • Add new item page
  • TextField and Switch
  • Binding action
  • Add mock item to todo list
  • Finish add item
  • Delete todo item
  • Edit todo item
  • Custom new layout
  • Adding new delegate
  • Refactor
  • Save data
  • Pushing edit view
  • Large navigation
  • Drag item
  • Drop item (in app)
  • Where to go from here?
Powered by GitBook
On this page

App's life cycle

PreviousIntroduction to XcodeNextUIViewController

Last updated 6 years ago

วงจรแอพ

โดยปกติแอพของเราจะมีสถานะใดสถานะหนึ่งใน 5 สถานะ โดยจะเริ่มจาก not running

เมื่อเรากดรันแอพ แอพจะเปลี่ยนมาอยู่ในสถานะ inactive ก่อนที่จะเข้าสู่สถานะ active เมื่อเราออกจากแอพ จะเปลี่ยนมาอยู่ที่สถานะ Background จากนั้นก็จะโดน System สั่งให้ Suspend สุดท้ายอาจถูกปิดไปแล้วกลับไปที่ not running

โดยที่เมื่อมีการเปลี่ยนสถานะต่าง ๆ UIKit จะเรียกผ่านไปให้ใครก็ตามที่เป็น UIApplicationDelegate ซึ่งจะว่าไปก็คือ AppDelegate.swift นั่นเอง

อ่านรายละเอียดเพิ่มเติมได้ที่

Managing Your App's Life Cycle
แผนภาพแสดงสถานะต่าง ๆ ของแอพ