Disable App Nap

巧了我就是萌 提交于 2019-12-11 12:48:46

问题


I really need to disable App Nap in my OS X application in Swift but I've looked all over the web and can't find an answer. Any help would be appreciated.


回答1:


Try this:

let myQueue = OperationQueue()
    let myActivity = ProcessInfo.processInfo.beginActivity(
        options: ProcessInfo.ActivityOptions.userInitiated,
        reason: "Batch processing files")
    myQueue.addOperation(
        {
            // Perform batch processing of files here
            ProcessInfo.processInfo.endActivity(myActivity)
        }
    )

Read more about App Nap on Apples reference site here.



来源:https://stackoverflow.com/questions/35679066/disable-app-nap

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!