简体   繁体   English

Select 使用 swift 的照片库中的多个图像

[英]Select multiple image from photo library using swift

I am new in IOS and i want to select multiple image from photo library using swift4 and get into array of images.Please help me to do this.我是 IOS 的新手,我想 select 使用 swift4 从照片库中获取多个图像并进入图像数组。请帮我这样做。

You can not use the multiple image in UIImagepickercontroller u have to use assetlibrary for it.您不能在 UIImagepickercontroller 中使用多个图像,您必须为此使用资产库。

You can use a custom image picker.您可以使用自定义图像选择器。 I think ImagePicker is best for Swift我认为ImagePicker最适合 Swift

Apple introduced PHPickerViewController in iOS14.苹果在 iOS14 中引入了 PHPickerViewController。

Advantages优点

  • No additional permission need to be implemented (its private by default)无需实现额外权限(默认为私有)
  • Supports Multi-selection (limit can also be specified)支持多选(也可以指定限制)
  • Zooming and previewing the selection缩放和预览选择

Documentation - https://developer.apple.com/documentation/photokit/phpickerviewcontroller文档 - https://developer.apple.com/documentation/photokit/phpickerviewcontroller
Video - https://developer.apple.com/videos/play/wwdc2020/10652/视频 - https://developer.apple.com/videos/play/wwdc2020/10652/

Hope this helps!希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Swift 3:如何允许用户从照片库中选择多个图像? - Swift 3: How to allow users to select multiple images from photo library? swift 我的 UIImagePicker 没有在来自照片库的 select 图像上显示任何图像 - swift my UIImagePicker doesn't show any image on select image from photo library 从照片库中选择多个图像 - Select Multiple Images from Photo Library 如何从照片库中选择多个图像? - How to select Multiple Images from Photo Library? 使用xcode和swift从照片库中选择要显示到Apple Watch上的图像视图的图像 - Selecting an image from the photo library to be displayed to a image view on the apple watch using xcode and swift Swift 4 错误在模拟器中使用 Firebase 尝试从照片库上传图像 - Swift 4 Error Using Firebase in Simulator Trying to Upload Image From Photo Library 从图库中拍摄照片并将图像上传到服务器swift 4 - take photo from library and upload image to server swift 4 Swift - AWS S3 从图片库上传图片并下载 - Swift - AWS S3 Upload Image from Photo Library and download it 使用Swift使用UIwebview从库中附加照片 - Attaching photo from library using UIwebview using swift swift:如何在不使用UIImagePickerController的情况下从照片库加载照片? - swift: How to load photos from photo library without using UIImagePickerController?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM