Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

Stutter in animation when dismissing from cancel button #97

Closed
wattson12 opened this issue Mar 12, 2015 · 8 comments
Closed

Stutter in animation when dismissing from cancel button #97

wattson12 opened this issue Mar 12, 2015 · 8 comments

Comments

@wattson12
Copy link

Because the camera overlay view is still running when the CardIOPaymentViewController is dismissed from the cancel button, there is a delay during animation (it moves about the height of the nav bar, pauses and then continues). There is no delay when dismissing from the done button after scanning is complete

The fix I have is to get access to the cardIOView property of cardIOViewController, and call stopSession before dismissing the view controller (category method I am using below).

Obviously using these private methods is not the nicest way of doing things so is there a better alternative to fixing this issue?

- (void)ttn_stopScanningSession
{
    UIViewController *cardIOViewController = self.topViewController;

    if ([cardIOViewController respondsToSelector:@selector(cardIOView)])
    {
        NSObject *cardIOView = [cardIOViewController cardIOView];

        if ([cardIOView respondsToSelector:@selector(stopSession)])
        {
            [cardIOView stopSession];
        }
    }
}
@dgoldman-pdx
Copy link
Member

@wattson12 there's a stutter we're aware of that we never found a solution for. If this is that same stutter, and your fix is all we need to solve it, that would be great!

When I get a chance, I'll see how your fix works when integrated into our code. (Or else you can try for yourself in card.io-iOS-source and send us a Pull Request!)

If it works for me, then you'll see a relevant mention in the card.io-iOS-SDK release notes. Until then, you should be safe to continue using your category.

@dgoldman-pdx
Copy link
Member

Ah. Different stutter. None of us had previously noticed this one that you're reporting, but now that I look I see what you mean.

I'll try to incorporate your fix in the coming week or so.

dgoldman-pdx pushed a commit to card-io/card.io-iOS-source that referenced this issue Mar 12, 2015
@wattson12
Copy link
Author

Great, thanks for this. Also I only realised there was an open source repo after submitting this, I'll make a proper pull request if I have any new issues.

@dgoldman-pdx
Copy link
Member

@wattson12 sounds great!

(Though please don't feel obliged to understand our somewhat convoluted code well enough to actually create a PR whenever you run into a problem.)

Hey -- so if you weren't aware of our open source repo, how did you figure out your fix?

@wattson12
Copy link
Author

I used the objc runtime to dump a list of class methods, and took a few educated guesses. Thanks for the well named methods 👍

@dgoldman-pdx
Copy link
Member

Well done!

@dgoldman-pdx
Copy link
Member

Now officially released.

@wattson12
Copy link
Author

Awesome, thanks for the quick fix

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants