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

Back button not working when animated #2

Closed
prine opened this issue Aug 7, 2015 · 5 comments
Closed

Back button not working when animated #2

prine opened this issue Aug 7, 2015 · 5 comments

Comments

@prine
Copy link

prine commented Aug 7, 2015

Hello

First of all thanks for your library! I really like it and already used it in my application :). I found out that the back button is kind of blocked when the animation is running.

I found out that if you want to have the UIView still beeing responsive you need to add the options UIViewAnimationOptions.AllowUserInteraction. So I changed the following code from:

UIView.animateWithDuration(alphaAnimationDurationOfLoadingView, animations: { () -> Void in
    self.busy_loadingView!.alpha = self.busy_options.alpha
})

To this one:

UIView.animateWithDuration(alphaAnimationDurationOfLoadingView, delay: 0.0, options: UIViewAnimationOptions.AllowUserInteraction, animations: { () -> Void in
    self.busy_loadingView!.alpha = self.busy_options.alpha
}) { (finished) -> Void in
    // Finished..
}

But unfortunately the back button is still no responsive during animation..

Tested with IOS 8.4 Xcode 6.4 (iPhone Simulator)

@gmertk
Copy link
Owner

gmertk commented Aug 7, 2015

Thank your for reporting both of the issues 👍 I get you back about them during the weekend.

@gmertk
Copy link
Owner

gmertk commented Aug 9, 2015

I am thinking about 2 solutions for this problem:

  1. Whenever the number of navbar's subviews changes, remove and re-insert the loading animation layer above the navbar's background view.
  2. Instead of inserting view, insert layer into _UINavigationBarBackground directly.

Trying number 2 at the moment. Will let you know!

@prine
Copy link
Author

prine commented Aug 11, 2015

Oukay, perfect. I also started replacing the UIView with a CALayer and I have successfully fixed the Back button problem, but the resizing problem still exists. Will create a Pullrequest when I have found a solution for the resizing problem.

@stremblayiOS
Copy link

All you have to do is add this at line 91 of UINavigationBar+Animation.swift

busy_loadingView?.userInteractionEnabled = false

@gmertk
Copy link
Owner

gmertk commented Dec 30, 2015

@stremblayiOS thank you!

@gmertk gmertk closed this as completed in fc3fc9e Jan 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants