Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have facing the same problem with this same .h and .m file but find one solution for this after working on it for 2 to 3 days and the solution is very simple what I have to change is in .m file in </p> <p><code>-(void)saveImage:(UIImage*)image toAlbum:(NSString*)albumName withCompletionBlock:(SaveImageCompletion)completionBlock</code> </p> <p>and in </p> <p><code>-(void)addAssetURL:(NSURL*)assetURL toAlbum:(NSString*)albumName withCompletionBlock:(SaveImageCompletion)completionBlock</code> </p> <p>methods i just add this before calling the inside methods</p> <pre><code>//THE CHANGE dispatch_async(dispatch_get_main_queue(),^{ // [self writeImageToSavedPhotosAlbum:image.CGImage orientation:(ALAssetOrientation)image.imageOrientation completionBlock:^(NSURL* assetURL, NSError* error) { //error handling if (error!=nil) { completionBlock(error); return; } //add the asset to the custom photo album [self addAssetURL: assetURL toAlbum:albumName withCompletionBlock:completionBlock]; }]; //THE CHANGE }); // </code></pre> <p>AND Same for the other one</p> <p>Happy Coding :)</p> <p><strong>EDIT</strong></p> <p>In second method I add a line below every <code>completionBlock(nil);</code> line</p> <pre><code>[[NSNotificationCenter defaultCenter] postNotificationName:kSaveSuccess object:nil]; </code></pre> <p>And I use this notification to make sure that image is saved in album too. Till that time I Shows <code>UIActivityIndicator</code> with some text message and after successfully saved image one popup message is shown indicated that image is saved in album with album name. And while this time the UI is unresponsive i.e. user can't do any thing other then pressing home button of device :) ;)</p> <p>Happy Coding :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload