![](/img/trans.png)
[英]Swift 3: How to allow users to select multiple images from photo library?
[英]landscape images from photo library swift 3.0
我正在制作風景應用程序,我只需要從照片庫中挑選風景照片,如何僅在風景中獲取照片?
使用image.imageOrientation
屬性過濾圖像。
UIImageOrientation參考- 這里
您可以使用PHAsset
類使用則predicate.And基礎上,篩選圖像來獲取所有所需規格的圖像image.imageOrientation
例如:-
let options = PHFetchOptions()
options.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: true)]
var images = PHAsset.fetchAssets(with: .image, options: options)
PHClass- 參考
您需要獲取尺寸圖像。 與>高度==>它是風景
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.