iOS开发中一些需要授权的功能在plist中添加的字段白名单

1.https

Info.plist中添加NSAppTransportSecurity类型Dictionary 

NSAppTransportSecurity下添加NSAllowsArbitraryLoads类型Boolean,值设为YES

    <key>NSAppTransportSecurity</key>

    <dict>

          <key>NSAllowsArbitraryLoads</key>

          <true/>

    </dict>

<!-- 相册 --> 
<key>NSPhotoLibraryUsageDescription</key> 
<string>App需要您的同意,才能访问相册</string> 
<!-- 相机 --> 
<key>NSCameraUsageDescription</key> 
<string>App需要您的同意,才能访问相机</string> 
<!-- 麦克风 --> 
<key>NSMicrophoneUsageDescription</key> 
<string>App需要您的同意,才能访问麦克风</string> 
<!-- 位置 --> 
<key>NSLocationUsageDescription</key> 
<string>App需要您的同意,才能访问位置</string> 
<!-- 在使用期间访问位置 --> 
<key>NSLocationWhenInUseUsageDescription</key> 
<string>App需要您的同意,才能在使用期间访问位置</string> 
<!-- 始终访问位置 --> 
<key>NSLocationAlwaysUsageDescription</key> 
<string>App需要您的同意,才能始终访问位置</string> 
<!-- 日历 --> 
<key>NSCalendarsUsageDescription</key> 
<string>App需要您的同意,才能访问日历</string> 
<!-- 提醒事项 --> 
<key>NSRemindersUsageDescription</key> 
<string>App需要您的同意,才能访问提醒事项</string> 
<!-- 运动与健身 --> 
<key>NSMotionUsageDescription</key> <string>App需要您的同意,才能访问运动与健身</string> 
<!-- 健康更新 --> 
<key>NSHealthUpdateUsageDescription</key> 
<string>App需要您的同意,才能访问健康更新 </string> 
<!-- 健康分享 --> 
<key>NSHealthShareUsageDescription</key> 
<string>App需要您的同意,才能访问健康分享</string> 
<!-- 蓝牙 --> 
<key>NSBluetoothPeripheralUsageDescription</key> 
<string>App需要您的同意,才能访问蓝牙</string> 
<!-- 媒体资料库 --> 
<key>NSAppleMusicUsageDescription</key> 

<string>App需要您的同意,才能访问媒体资料库</string>

<!-- 相机相册显示中文,对应系统语言 --> 
<key>Localized resources can be mixed</key>

<BOOL>YES<BOOL>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要在iOS的画画窗口添加自定义视图,您需要按照以下步骤进行操作: 1.创建一个自定义视图,继承自UIView类。 2.在需要使用画功能的UIViewController添加以下代码以启用画画: ```swift override func viewDidLoad() { super.viewDidLoad() // 允许画画 self.isModalInPresentation = true } ``` 3.在需要添加自定义视图的UIViewController,创建一个AVPlayerViewController实例,并将其添加到视图层次结构: ```swift // 创建一个AVPlayerViewController实例 let playerViewController = AVPlayerViewController() // 添加到视图层次结构 addChild(playerViewController) view.addSubview(playerViewController.view) playerViewController.didMove(toParent: self) ``` 4.在AVPlayerViewController实例,使用AVPictureInPictureController的`playerViewController(_:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:)`方法,在画画结束后恢复自定义视图: ```swift // 在画画结束后恢复自定义视图 func playerViewController(_ playerViewController: AVPlayerViewController, restoreUserInterfaceForPictureInPictureStopWithCompletionHandler completionHandler: @escaping (Bool) -> Void) { // 创建自定义视图 let customView = CustomView(frame: playerViewController.view.bounds) // 添加到视图层次结构 playerViewController.view.addSubview(customView) playerViewController.view.bringSubviewToFront(customView) completionHandler(true) } ``` 请注意,您需要info.plist文件添加“Supported external accessory protocols”键,并将其设置为“com.apple.avfoundation.tunnel”的值,以便在iOS 14及更高版本启用画功能

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值