ios – PostingStyle of NotificationQueue


I have learned that when using NotificationQueue to post notifications, you can choose a postingStyle. This is an enumeration with three main values: whenIdle, asap, and now.

Among them, now represents synchronous posting, which is no different from using the post method of NotificationCenter.

My question is, both whenIdle and asap seem to rely on the Runloop to determine the timing of asynchronous posting. What conditions should I consider when deciding which asynchronous posting method is most appropriate?

    public enum PostingStyle : UInt, @unchecked Sendable {

        
        case whenIdle = 1

        case asap = 2

        case now = 3
    }

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img