Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imageSnapshotAfterScreenUpdates Problem when flipping different Views on different Screens #39

Open
makadev opened this issue Feb 4, 2015 · 2 comments
Labels

Comments

@makadev
Copy link

makadev commented Feb 4, 2015

I'm using the JDFlipImageView flipToView Method to animate 2
Views concurrently. One on an iOS 8 Device and one on a connected
Beamer (simply an UIWindow with UIView where an UIImageView is
displayed and flipped, same constellation on the iOS Device).
The animation is invoked first for the Beamer's View and then for the
iOS Device View.

It's quite simple something like:

  ...
  if(self->secondScreen) {
    UIImageView* beamerLastImageView = self->newBeamerImageView;
    self->newBeamerImageView = [[UIImageView alloc]
initWithImage:self->beamerImage];
  }
  UIImageView* lastImageView = self->newImageView;
  self->newImageView = [[UIImageView alloc] initWithImage:self->newImage];
  ...
  if(self->secondScreen) {
    [beamerLastImageView flipToView:self->newBeamerImageView
duration:dur direction:dir completion:^(BOOL finished){ ... }];
  }
  [lastImageView flipToView:self->newImageView duration:dur
direction:dir completion:^(BOOL finished){ ... }];

The Problem is that shortly before the flip animation an Image appears
on the iOS Device View, but not on the Beamer. It is half the Size
(may be due to the Beamers windows frame being 1/2 of that of the
Devices View) and rotated by 180 degree.

After few hours of reading my code (can't exactly debug the APP while
using a connected display) which is quite short for the animations, I
started reading through the code path invoked by flipToView and it
seems that imageSnapshotAfterScreenUpdates either makes a wrong Image
or somehow mixes things between the 2 screens.

For now I worked around it by exposing the
addFlipViewWithAnimationFromImage and using my own Images directly
from the UIImageViews. This works without Problems.

I couldn't find any Information as to why this Problem occurs.

@calimarkus
Copy link
Owner

For ImageViews you can also use JDFlipImageView and setImageAnimated:: https://github.com/jaydee3/JDFlipNumberView/blob/master/JDFlipNumberView/JDFlipImageView.h

@makadev
Copy link
Author

makadev commented Mar 21, 2015

Thank you for the Information.

I'll leave it up to you to close this issue or investigate it further.

@calimarkus calimarkus added the bug label May 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants