确定在系统警报时点击了哪个按钮

Determine which button was tapped on system alert

我正在展示 SKStoreReviewController.requestReview(),我希望在 UserDefaults 中有一个 boolean,如果用户点击取消,我会制作 true

考虑到这是一个 OS 警报,有没有办法确定是否点击了取消?

无法访问选择了哪个按钮。我很好奇你为什么需要这个功能? OS 将决定是否应向用户显示提醒,具体取决于几个因素,包括用户上次发表评论或取消评论的时间。

苹果开发者网站: https://developer.apple.com/documentation/storekit/skstorereviewcontroller/2851536-requestreview

Although you should call this method when it makes sense in the user experience flow of your app, the actual display of a rating/review request view is governed by App Store policy. Because this method may or may not present an alert, it's not appropriate to call it in response to a button tap or other user action.