image.png
添加系统 Framework(比如 StoreKit)的方式
打开你的 .xcodeproj 或 .xcworkspace
选中你的 Target
点击上方的 "Build Phases"
找到并展开:"Link Binary With Libraries"
点下方的 "+" 按钮
搜索 StoreKit.framework,然后添加它
添加成功后,Xcode 会自动将它写入你的 project.pbxproj 文件,表现为你看到的这段:
771D92762AF494500046B522 /* StoreKit.framework in Frameworks */ = {
isa = PBXBuildFile;
fileRef = 771D92752AF494500046B522 /* StoreKit.framework */;
};
使用 StoreKit 场景1:
#import <StoreKit/StoreKit.h>
使用 StoreKit 场景2:
请求 App Store 评分弹窗(无需上报)
import StoreKit
if let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene {
SKStoreReviewController.requestReview(in: scene)
}