mariohahn / MHVideoPhotoGallery

A Photo and Video Gallery

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dismiss animation works only when pressing done button

ale84 opened this issue · comments

I made an example project that uses MHVideoPhotoGallery, but the dismiss animation doesn't work. The image doesn't animate, instead it just disappear when you let go the finger, but when I click the Done button the animation works as expected.

See this example video: https://dl.dropboxusercontent.com/u/3947595/prova_mh.mov

This is the code I used to present the image:

 MHGalleryItem *landschaft1 = [[MHGalleryItem alloc]initWithURL:@"http://de.flash-screen.com/free-wallpaper/bezaubernde-landschaftsabbildung-hd/hd-bezaubernde-landschaftsder-tapete,1920x1200,56420.jpg"
                                                       galleryType:MHGalleryTypeImage];

    MHGalleryItem *landschaft2 = [[MHGalleryItem alloc]initWithURL:@"http://de.flash-screen.com/free-wallpaper/bezaubernde-landschaftsabbildung-hd/hd-bezaubernde-landschaftsder-tapete,1920x1200,56420.jpg"
                                                       galleryType:MHGalleryTypeImage];
    __weak ViewController *blockSelf = self;

    self.iv.presenter.interactive = YES;

    [self.iv setInseractiveGalleryPresentionWithItems:@[landschaft1, landschaft2] currentImageIndex:0 currentViewController:self finishCallback:^(NSInteger currentIndex,UIImage *image,MHTransitionDismissMHGallery *interactiveTransition,MHGalleryViewMode viewMode) {
        if (viewMode == MHGalleryViewModeOverView) {
            [blockSelf dismissViewControllerAnimated:YES completion:nil];
        }else{
            blockSelf.iv.image = image;
            blockSelf.iv.currentImageIndex = currentIndex;
            [blockSelf.presentedViewController dismissViewControllerAnimated:YES dismissImageView:blockSelf.iv completion:nil];
        }
    }];


    [self.iv sd_setImageWithURL:[NSURL URLWithString:landschaft1.URLString]];
    [self.iv setUserInteractionEnabled:YES];

    self.iv.shoudlUsePanGestureReconizer = YES;

Can you share your Example Code?
xCode version? iOS Version?

I'm using Xcode 6.2, and running the example on an iPhone 5c, iOS 8.1.1

Here you can find the example project: https://dl.dropboxusercontent.com/u/3947595/ProvaMH.zip

I have seen that you are using version v1.6.6

Try using the newest one: v1.6.7

hmm... I can't see any Issues if i run the Example Code for both Versions..

I tried to use v1.6.7, but the animation is still not working.
I also updated Xcode to version 6.3 and installed the example on an iPhone 6 with iOS 8.3, but the result is the same.
Also, if I run the Example within the library, everything is fine.
I don't know what it could be.

I'm also facing this issue
xCode 7.1.1
iOs 9.1

@ale84 have you solved this?

I think the problem is related to the contentMode of the imageView from which the gallery is presented.
Setting the contentMode from ScaleToFill to AspectFill solved the problem in my example project.