我的应用程序请求允许添加到照片库,但我不需要读取权限.我看到应该有一个选项,但我找不到如何具体要求这种访问.
我这样做:
PHPhotoLibrary.requestAuthorization({status in
if(status == .authorized){
// save
}
})
Run Code Online (Sandbox Code Playgroud)
这样可以正常工作,但显示的请求是完全访问权限.
我可以指定我只需要写访问权限吗?我在info.plist中设置了两个隐私密钥
我在模拟器上运行它,ios 11.4
我正在使用 viewWillTransition 函数来检测旋转,但我想为动画的完成事件添加一个闭包,或者以其他方式检测旋转已完成。
在以前的 swift 版本中,有一个 didRotate 函数,但已被弃用。
编辑
public override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator){
// I want to add a delegate or closure here when the coordinator's animation is finished
}
Run Code Online (Sandbox Code Playgroud)