美文网首页
MacOS开发笔记-打开隐私权限

MacOS开发笔记-打开隐私权限

作者: voyager3 | 来源:发表于2020-07-29 18:55 被阅读0次

示例代码如下:

        self.view.window?.level = .normal
        let success = LocalSecurity().getTrust()
        if success {
            NSWorkspace.shared.openFile("/System/Library/PreferencePanes/Security.prefPane")
        }else{
            AXIsProcessTrustedWithOptions(
            [kAXTrustedCheckOptionPrompt.takeUnretainedValue() as String: true] as CFDictionary)
        }

相关文章

网友评论

      本文标题:MacOS开发笔记-打开隐私权限

      本文链接:https://www.haomeiwen.com/subject/raekrktx.html