Post

Replies

Boosts

Views

Activity

How long can widget be executed after being activated by the iOS system
Widgets are activated by the iOS system at regular intervals, and the task code defined in the TimelineProvider is executed. How long can this task code be executed at most? I don't think the system will allow tasks defined in the timeline to be executed continuously (looking like a background resident program), so there must be a time limit. If you know, or if there are related document links, please let me know Thank you.
0
0
356
Mar ’24
Why 'keyboardWillShowNotification' is fired when background taped in iOS 14?
Why in iOS14 (or at least iOS14.4.1 iPhone X) keyboardWillShowNotification is fired when background(UIScrollerView) taped, while in iOS13 is not? I am trying to run a function when the keyboard shows and disappears, have the following code: import UIKit class ViewController: UIViewController {     @IBOutlet weak var scrollView: UIScrollView!     @IBOutlet weak var textField: UITextField!     let notificationCenter = NotificationCenter.default         override func viewDidLoad() {         super.viewDidLoad()                 notificationCenter.addObserver(self, selector: #selector(keyboardWillShow), name: UIResponder.keyboardWillShowNotification, object: nil)         notificationCenter.addObserver(self, selector: #selector(keyboardWillHide), name: UIResponder.keyboardWillHideNotification, object: nil)     }         deinit {         notificationCenter.removeObserver(self)     }     @objc private func keyboardWillShow(_ notification: Notification) {        updateBottomLayoutConstraintWithNotification(notification: notification, bottomConstraint: nil, tag: "keyboardWillShow()")     }     @objc private func keyboardWillHide(_ notification: Notification) {        updateBottomLayoutConstraintWithNotification(notification: notification, bottomConstraint: nil, tag: "keyboardWillHide()")     }         func updateBottomLayoutConstraintWithNotification(notification: Notification, bottomConstraint: NSLayoutConstraint?, tag: String = "") {         print("[Caller Name] \(tag)")     } } Operation steps Tap the textField(Keyboard Raised) Tap the background(UIScrollerView) Such a log will be generated [Caller Name] keyboardWillShow() [Caller Name] keyboardWillShow() Thank you for your attention!
1
0
1.4k
Jul ’21