返回 Skill 列表
extension
分类: 开发与工程无需 API Key

"camera"

相机和照片捕捉:PhotosPicker,AVCaptureSession,UIViewControllerRepresentable封装,权限。在实现与相机相关的应用程序功能时使用。

person作者: jakexiaohubgithub

Camera

CAMERA & PHOTOS:

  • PhotosPicker (PhotosUI) for gallery selection — no permissions needed for limited access
  • For camera capture: AVCaptureSession + AVCapturePhotoOutput + UIViewControllerRepresentable wrapper
  • Camera requires NSCameraUsageDescription permission (add CONFIG_CHANGES)
  • Full photo library requires NSPhotoLibraryUsageDescription
  • Use @State private var selectedItem: PhotosPickerItem? with .onChange to load
  • Load image: try await item.loadTransferable(type: Data.self)