photosframework

How to handle multiple images with large size?

痴心易碎 提交于 2019-12-25 06:32:04
问题 I have list of selected images from Photos gallery. The array list contain selected PHAssets from Photos <PHAsset: 0x131334350> 768AD8BA-FE7A-4EE9-B2CF-4DD4AEBE2AE9/L0/001 mediaType=1/0, sourceType=1, (2448x3264), creationDate=2016-03-11 06:50:09 +0000, location=1, hidden=0, favorite=0 ", "<PHAsset: 0x131334260> CA962E42-A367-4E8D-85C8-934F8C76FE78/L0/001 mediaType=1/0, sourceType=1, (2448x3264), creationDate=2016-03-11 06:50:08 +0000, location=1, hidden=0, favorite=0 " Now i want to store

AssetsLibrary framework broken on iOS 8

删除回忆录丶 提交于 2019-12-18 11:31:32
问题 I have run into an issue on iOS 8 with the Assets Library framework that appears to be a bug in iOS 8. If I create an album called 'MyMedia' and then delete it, then when I try to create the album again, this chunk of code below returns 'nil' indicating that the album 'MyMedia' exists even though it does not because I deleted it using the 'Photos' app. __block ALAssetsGroup *myGroup = nil; __block BOOL addAssetDone = false; NSString *albumName = @"MyMedia"; [assetsLib

Iterate through photo library on OS X?

*爱你&永不变心* 提交于 2019-12-18 05:07:33
问题 I'm trying to iterate through a user's photo library on OS X. On iOS, I would use the Photos framework, but apparently that's not available on OS X, and we're supposed to use the Media Library framework instead. However, while I was able to use the code linked above to get access to a MLMediaSource object, I'm having a hard time figuring out how to iterate through the photo assets. The Media Library Framework documentation makes reference to a mediaObjectForIdentifier: method, which sounds

How to use PHCachingImageManager

人走茶凉 提交于 2019-12-17 19:07:33
问题 I know that there is already this question on SO, but I don't think that the given answer is satisfying/complete: How can IOS Photos app can show hundreds of photos in one screen? What I want to achieve I want something like the image selection in whatsapp (iOS) (see screenshot). When you open the camera, there is also a horizontal slider where you can see all images from your gallery. What I tried Right now I have the following code in my appDelegate: let options = PHFetchOptions() options

How to add pagination to PHAsset fetching from Photos Framework?

前提是你 提交于 2019-12-14 03:59:18
问题 I am trying to get all the photos from cameraRoll using Photos framework but its taking a lot of time to fetch all the photos from cameraRoll. Is their anyway to add pagination to it ? so i can fetch while scrolling. var images = [UIImage]() var assets = [PHAsset]() fileprivate func assetsFetchOptions() -> PHFetchOptions { let fetchOptions = PHFetchOptions() //fetchOptions.fetchLimit = 40 //uncomment to limit photo let sortDescriptor = NSSortDescriptor(key: "creationDate", ascending: false)

NSPredicate to exclude slow motion videos from PHFetchResults

一个人想着一个人 提交于 2019-12-13 06:03:21
问题 NSString *predicateFormat = [NSString stringWithFormat: @"mediaSubtype = %zd", PHAssetMediaSubtypeVideoHighFrameRate]; NSPredicate *predicate = [NSPredicate predicateWithFormat: predicateFormat]; PHFetchOptions *fetchOptions = [PHFetchOptions new]; fetchOptions.predicate = predicate; PHFetchResult *userAlbums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeSmartAlbumVideos options:fetchOptions]; This is my code to fetch videos

How to find identifier of a photo asset in IOS

◇◆丶佛笑我妖孽 提交于 2019-12-12 18:27:19
问题 I am writing an app which saves a photo stored in a custom album and associates other information with it in an object. The object is then saved in core data. I would like to store a reference to the photo in the object. Is there a unique identifier that is available or can be derived. I need to be able to access the photo. I am using Photos framework. 回答1: Keep in mind that localIdentifier's may change when iOS is updated, and in this case whatever value you had saved locally will become

Photos framework: Connection to assetsd was interrupted or assetsd died

不打扰是莪最后的温柔 提交于 2019-12-12 07:53:53
问题 I am getting this error when I am trying to play multiple videos using this swift library (https://github.com/piemonte/player). Not sure if it's related to that player, or to the Photos framework or what though. What happens is, I have a view that will display either a photo or a video. Everything works fine a few times until a few videos have played and then this message will pop up, followed by all the videos not being able to play and in their place you just see a black screen, and then I

When can I use Photos Framework and iCloud Photo Library?

感情迁移 提交于 2019-12-12 06:16:30
问题 I want to provide my users a photo picker which displays all their images similarly to the Photos app. Currently I can use two frameworks, the old Assets Library and the new Photos Library frameworks. Is there any recommendation how should I choose between these two? The documentation states: In iOS 8.0 and later, use the Photos framework instead of the Assets Library framework. The Photos framework provides more features and better performance for working with a user’s photo library. But as

Photo Editing Extension - Revert Image to Original

我怕爱的太早我们不能终老 提交于 2019-12-11 15:49:35
问题 I'm developing a photo editing extension for iOS, bundled in a container app that provides the same photo editing functionality. In order to reuse code, I have a view controller class that adopts the required PHContentEditingController protocol, and I subclassed it for use both as the main interface of the app extension, and as the "working screen" of the container app. On the editing extension, the controller's methods are called by the Photos app's editing session as described in Apple's