我正在制作风景应用程序,我只需要从图片库中挑选风景照片,我如何获取只在风景中的照片?
发布于 2017-01-17 15:44:02
使用image.imageOrientation属性筛选图像。
UIImageOrientation参考- Here
您可以使用PHAsset类通过predicate.And获取所有具有所需规格的图像,然后根据image.imageOrientation对图像进行过滤
例如:-
let options = PHFetchOptions()
options.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: true)]
var images = PHAsset.fetchAssets(with: .image, options: options)PHClass - Ref
发布于 2017-01-17 16:29:24
你需要得到大小的图像。使用> height ==>,它是横向的
https://stackoverflow.com/questions/41691482
复制相似问题