首页 > 编程语言 > 详细

swift-判断是否已获得相机、相册权限

时间:2017-07-05 15:01:38      阅读:632      评论:0      收藏:0      [点我收藏+]

// 相机权限

func isRightCamera() -> Bool {

    let authStatus = AVCaptureDevice.authorizationStatus(forMediaType: AVMediaTypeVideo)

    return authStatus != .restricted && authStatus != .denied

}


// 相册权限

func isRightPhoto() -> Bool {

    let authStatus = ALAssetsLibrary.authorizationStatus()

    return authStatus != .restricted && authStatus != .denied

}


swift-判断是否已获得相机、相册权限

原文:http://www.cnblogs.com/Free-Thinker/p/7121061.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!