Tag: 图像库

当点击列表中的项目时,获得列表和全尺寸图像的缩略图

所以我使用下面的代码来获取所有图像库中的工作正常: func grabPhotos(){ let imgManager = PHImageManager.default() let requestOptions = PHImageRequestOptions() requestOptions.isSynchronous = true requestOptions.deliveryMode = .highQualityFormat let fetchOptions = PHFetchOptions() fetchOptions.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: true)] if let fetchResults : PHFetchResult = PHAsset.fetchAssets(with: .image, options: fetchOptions){ if fetchResults.count>0{ for i in 0..<fetchResults.count{ imgManager.requestImage(for: fetchResults.object(at: i), targetSize: CGSize(width:100, height: 100), contentMode: .aspectFill, options: requestOptions, resultHandler: […]

如何将video片段保存到照片库 – ios 8&9

我已经努力将video剪辑保存到照片库。 这里的代码如下,但它不工作。 即使saveVideo返回true,但我打开照片库无法获取video剪辑。 文件path 是本地文档目录上的位置 func saveVideo(filePath: String) { UISaveVideoAtPathToSavedPhotosAlbum (filePath, self,"video:didFinishSavingWithError:contextInfo:", nil) } func video(filePath: String, didFinishSavingWithError error: NSError?, contextInfo:UnsafePointer<Void>) { if error == nil { let ac = UIAlertController(title: "Saved!", message: "Your altered video has been saved to your gallery.", preferredStyle: .Alert) ac.addAction(UIAlertAction(title: "OK", style: .Default, handler: nil)) self.presentViewController(ac, animated: true, completion: nil) […]

如何在模仿iPhone的默认图库的应用程序中实现图像库?

我想在我的iPhone应用程序中实现一个图片库,它只会从设备库中获取这些图片,这些图片既可以从应用程序中select,也可以从应用程序中获取图片。 请build议任何简单的方法来这样做。