Git Product home page Git Product logo

Comments (7)

Kjuly avatar Kjuly commented on June 14, 2024

What's ur lib version used? Have u add reference of Photos.framework? Plz take a look at this issue (#16) first, maybe will helps.

from alassetslibrary-customphotoalbum.

bosspopuli avatar bosspopuli commented on June 14, 2024

Yes i import Photos.framework. and i use the last versión. The code allways pass for this else

 else {
          // code that always creates an album on iOS 7.x.x but fails
          // in certain situations such as if album has been deleted
          // previously on iOS 8.x.
          [self addAssetsGroupAlbumWithName:albumName
                                resultBlock:addPhotoToLibraryBlock
                               failureBlock:failure];
        }

from alassetslibrary-customphotoalbum.

Kjuly avatar Kjuly commented on June 14, 2024

Seems u cannot get the PHPhotoLibrary class, can confirm it?

Class PHPhotoLibrary_class = NSClassFromString(@"PHPhotoLibrary");
if (PHPhotoLibrary_class) {
  ...
} else {
   // code that always creates an album on iOS 7.x.x but fails
   // in certain situations such as if album has been deleted
   // previously on iOS 8.x.
   [self addAssetsGroupAlbumWithName:albumName
                         resultBlock:addPhotoToLibraryBlock
                        failureBlock:failure];
}

Wait, u're testing the demo project? Seems the demo project has not imported the framework yet.

from alassetslibrary-customphotoalbum.

bosspopuli avatar bosspopuli commented on June 14, 2024

The demo project work fine. In my project in a last version worked fine but now don´t work.

captura de pantalla 2015-04-21 a las 11 35 43

This in your class

#import "ALAssetsLibrary+CustomPhotoAlbum.h"
#import <Photos/PHPhotoLibrary.h>

This in my class

-(void)photo{

    UIImage *image = [ImageGenerator imageWithView:self.view];
    NSDateFormatter * dateFormatter = [NSDateFormatter new];
    [dateFormatter setDateFormat:@"YYYYMMDD"];
    _namePhoto = [dateFormatter stringFromDate:[NSDate date]];   
    [ImageGenerator saveImage:image name:_namePhoto];

    [self.library saveImage:image toAlbum:self.sessionData.merchant.merchantName completion:^(NSURL *assetURL, NSError *error) {
        if (error)
            DLog(@"ERROR SAVE ALBUM");
        [self performSelectorOnMainThread:@selector(endPhoto) withObject:nil waitUntilDone:YES];
    } failure:^(NSError *error) {
        DLog(@"FAILURE SAVE ALBUM");        
        [self performSelectorOnMainThread:@selector(endPhoto) withObject:nil waitUntilDone:YES];
    }];
}

Allways return "failure save album" and not recognize PHPhotoLibrary...

This Image is saved in the camera roll

from alassetslibrary-customphotoalbum.

Kjuly avatar Kjuly commented on June 14, 2024

Step 1

Generally, the failure block will be invoked if user denied ur app to access to the assets library. Plz make sure ur app is allowed to access the photos app in Settings.app after u upgraded ur system version.


Step 2

Seems u want to change the name for photo, then save it to album. Plz comment out the code snippet below to avoid other factors before do testing first.

NSDateFormatter * dateFormatter = [NSDateFormatter new];
[dateFormatter setDateFormat:@"YYYYMMDD"];
_namePhoto = [dateFormatter stringFromDate:[NSDate date]];   
[ImageGenerator saveImage:image name:_namePhoto];

Step 3

Check the value of image & self.sessionData.merchant.merchantName, make sure they're the one u want.

from alassetslibrary-customphotoalbum.

bosspopuli avatar bosspopuli commented on June 14, 2024

In the Navigation project appear the Photos.framework but not in the target. I add the framework again and it works!!! Really thanks! When the xcode updated, it removed my framework...

Thanks again!

from alassetslibrary-customphotoalbum.

Kjuly avatar Kjuly commented on June 14, 2024

Haha, cool!

from alassetslibrary-customphotoalbum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.