我是swift的新手。我正在创建一个应用程序,我需要从图库上传图片。我如何从图库上传多张图片到我的应用程序。有人能帮我吗?提前感谢。
kpbpu0081#
试试这个可能会有帮助!!//转到Galary进行图像拾取
if UIImagePickerController.isSourceTypeAvailable(.photoLibrary) { let imagePicker = UIImagePickerController() imagePicker.delegate = refrenceViewController as! UIImagePickerControllerDelegate & UINavigationControllerDelegate imagePicker.sourceType = .photoLibrary; imagePicker.allowsEditing = true refrenceViewController.present(imagePicker, animated: true, completion: nil) }
并添加对info.plist权限和访问galary的顺序
wecizke32#
你一次只能从Apple Photo FrameWork获取一张图片。如果你想允许多张图片,请使用Librarys。我也在我的一个应用程序中使用BSImagePicker。
2条答案
按热度按时间kpbpu0081#
试试这个可能会有帮助!!
//转到Galary进行图像拾取
并添加对info.plist权限和访问galary的顺序
wecizke32#
你一次只能从Apple Photo FrameWork获取一张图片。如果你想允许多张图片,请使用Librarys。我也在我的一个应用程序中使用BSImagePicker。