Post

Replies

Boosts

Views

Activity

viewIsAppearing not be called in children Controllers below iOS 16?
I see viewIsAppearing is available on iOS 13 and above, but when I use it, found that the function not be called below iOS 16 https://developer.apple.com/documentation/uikit/uiviewcontroller/4195485-viewisappearing environment: Macos 14.4.1, Xcode 15.3 import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let sub = SubViewController() addChild(sub) view.addSubview(sub.view) } @available(iOS 13.0, *) override func viewIsAppearing(_ animated: Bool) { super.viewIsAppearing(animated) print("ViewController viewIsAppearing") } } class SubViewController: UIViewController { @available(iOS 13.0, *) override func viewIsAppearing(_ animated: Bool) { super.viewIsAppearing(animated) print("SubViewController viewIsAppearing") } } In iOS 15 devcice console log: ViewController viewIsAppearing iOS 16, 17: ViewController viewIsAppearing SubViewController viewIsAppearing
2
0
597
Mar ’24