📜  记录权限 swift 4 - Swift 代码示例

📅  最后修改于: 2022-03-11 15:01:03.589000             🧑  作者: Mango

代码示例1
import AVFoundation

switch AVAudioSession.sharedInstance().recordPermission {
case AVAudioSessionRecordPermission.granted:
    print("Permission granted")
case AVAudioSessionRecordPermission.denied:
    print("Pemission denied")
case AVAudioSessionRecordPermission.undetermined:
    print("Request permission here")
    AVAudioSession.sharedInstance().requestRecordPermission({ (granted) in
        // Handle granted
    })
}