gpt4 book ai didi

ios - 当系统 UIAlertView 关闭时通知

转载 作者:行者123 更新时间:2023-11-29 10:38:52 25 4
gpt4 key购买 nike

我正在尝试使用新的照片框架,但我似乎找不到在“允许访问照片”警报 View 完成时收到通知的方法。有什么想法吗?

我尝试通过通知来做到这一点。

[[NSNotificationCenter defaultCenter] addObserverForName:UIWindowDidResignKeyNotification object:self queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *note) {
//figure out the result of the request
// This never gets called
}];

最佳答案

使用提供的 API,它可以准确地满足您的需求。

+[PHPhotoLibrary requestAuthorization:(void (^)(PHAuthorizationStatus status))handler]

This method always returns immediately. If the user has previously granted or denied photo library access permission, it executes the handler block when called; otherwise, it displays an alert and executes the block only after the user has responded to the alert.

关于ios - 当系统 UIAlertView 关闭时通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25536751/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com