alassetslibrary

ALAssetsLibrary get Camera Roll

风格不统一 提交于 2019-12-14 03:40:05
问题 I enumerate all assets groups using ALAssetsLibrary Here is code: ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; void (^enumerate)(ALAssetsGroup *, BOOL *) = ^(ALAssetsGroup *group, BOOL *stop) { if (group == nil) { // enumerated all albums.. } // I hot to check if group is Camera Roll ? }; [library enumerateGroupsWithTypes:ALAssetsGroupAll usingBlock:enumerate failureBlock:nil]; How to check if some current enumerated is CameraRoll ? Edit: As i tested it was always the last,

ALAssetsLibrary addAssetsGroupAlbumWithName is not working on iOS 9

╄→гoц情女王★ 提交于 2019-12-13 07:01:46
问题 I need to add group with name "MyGroupName" in ALAssetsLibrary . So I have used below code. ALAssetsLibrary * library = [[ALAssetsLibrary alloc] init]; __weak ALAssetsLibrary *lib = library; [library addAssetsGroupAlbumWithName:@"MyGroupName" resultBlock:^(ALAssetsGroup *group) { [lib enumerateGroupsWithTypes:ALAssetsGroupAlbum usingBlock:^(ALAssetsGroup *g, BOOL *stop) { if ([[g valueForProperty:ALAssetsGroupPropertyName] isEqualToString:@"MyGroupName"]) { NSLog(@"group created with name

SWIFT ALAssetsLibrary not enumerating groups

一曲冷凌霜 提交于 2019-12-12 15:34:49
问题 I'm trying to gather thumbnails of all the user's images into an array, but when I call the enumerateAssetsUsingBlock method of ALAssetsLibrary nothing seems to happen. import UIKit import AssetsLibrary class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate { @IBOutlet var photoLibView: UICollectionView var assetLibrary : ALAssetsLibrary = ALAssetsLibrary() func showCustomLibrary() { self.assetLibrary = ALAssetsLibrary() var assetsArray :

iOS showing Image from ALAsset in UITableView

大城市里の小女人 提交于 2019-12-12 09:26:27
问题 I have a db where items are stored. These items can be different kinds of type like text, videos and images. When the View is loaded I fetch these items from the DB and I show them in a UITableView. The problem I am facing is related to show the images in the table view. Basically in the DB I store the ALAsset link related to the picture and from it I try to get its image using this code: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ /

Asset Library issue in iOS - 5

心已入冬 提交于 2019-12-12 09:12:52
问题 i am using asset library for getting image from url , my code is ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *myasset){ ALAssetRepresentation *rep = [myasset defaultRepresentation]; CGImageRef iref = [rep fullResolutionImage]; UIImage *largeimage; if (iref) { largeimage = [UIImage imageWithCGImage:iref]; } [self customeButtonCreated:self]; NSData* thumbImageData = [[NSData alloc] initWithContentsOfFile:imagePath]; btn1.frame = CGRectMake(x, y, WIDTH, HEIGHT); [btn1 setTag

How we can upload camera roll image automatically to server

若如初见. 提交于 2019-12-12 04:56:16
问题 How I can upload a camera roll image automatically to server? This same thing implemented in Dropbox and Google Photos and some other apps also. What should I do to achieve such kind of functionality in my app? 回答1: What you are asking is not a single question, but a paradigm. An entire process, that includes: Obtaining authorisation to access the photo library. Accessing assets (images/videos) in the user's gallery. Uploading to a server. Read up on all the three, if you want to achieve this

Get the last saved Photo in photo album

落花浮王杯 提交于 2019-12-12 04:47:48
问题 I use AVFoundation framework for taking photo and save it to photoAlbum: - (void)captureStillImage { AVCaptureConnection *videoConnection = nil; for (AVCaptureConnection *connection in [[self stillImageOutput] connections]) { for (AVCaptureInputPort *port in [connection inputPorts]) { if ([[port mediaType] isEqual:AVMediaTypeVideo]) { videoConnection = connection; break; } } if (videoConnection) { break; } }if ([videoConnection isVideoOrientationSupported]) [videoConnection

How to get photos from camera roll?

落花浮王杯 提交于 2019-12-12 02:21:53
问题 I tried to use ALAssetLibrary to get albums and photos. This is my code: void (^assetEnumerator)(struct ALAsset *, NSUInteger, BOOL *) = ^(ALAsset *result, NSUInteger index, BOOL *stop) { if(result != NULL) { NSLog(@"See Asset: %@", result); } }; void (^assetGroupEnumerator)(struct ALAssetsGroup *, BOOL *) = ^(ALAssetsGroup *group, BOOL *stop) { if(group != nil) { [group enumerateAssetsUsingBlock:assetEnumerator]; } }; ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; [library

How can I get my alassets from my library in date order across all photo albums?

不想你离开。 提交于 2019-12-12 01:25:41
问题 I've been looking around and have only found answers in pulling out assets in groups. What I want to do is get all the image/photo data from my iPhone/iPad not grouped by album (ie Camera Roll, custom folders, etc) but just by date. I don't see any examples here or on Apple docs on how to just say "Give me all my assets but use this predicate to sort them" Everything I've seen uses the enumerator to return the results by groups. Setting the group setting to "ALL" just returns the assets in

ALAssetsLibrary get all videos

天大地大妈咪最大 提交于 2019-12-11 19:07:12
问题 I am making a camera app where I want to get to all of the videos users have created on their iPhone. Currently the code I have gets the videos from user Camera Roll only. Some my users have complained that they have multiple custom folders created under their Photo Album app and they store some videos in there. Since my code only looks at Camera Roll, it doesn't pickup the movies from their other folders. Is it possible that I can get to their other folders? This is what I have so far.