Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Weird behavior with button near notification center pulldown on iPad

I've got a UIButton (the 'back button') in the upper left corner of an iPad application that dismisses a view controller. I've discovered that if you tap this button slightly too high, you can both activate the button and start to pull down the notifications pane at the same time. When this happens, my -viewWillDisappear gets executed and stops the animations in the view, but the view doesn't actually dismiss. Of course, the notifications pane doesn't come down all the way, so the net result looks like my animations crashed, and that the back button failed as well.

The obvious solution would be to just move the button down a little bit, but as that is undesirable for layout reasons, I'm curious if:

  1. Anyone has ever seen this behavior before.
  2. If it's well-defined behavior, and if so where does Apple describe it.
  3. Are there any known work-arounds?

EDIT: actually looks like less of an issue after all. Turns out it's my -applicationWillResignActive that's getting called, not -viewWillDisappear. Still looks bad, but at least the behavior is well defined. I'm not activating my home button at all, just pulling down the notifications pane.

like image 887
Garrett Disco Avatar asked Aug 27 '13 20:08

Garrett Disco


People also ask

How do I get rid of the bubbles on my iPhone Notification Center?

Question: Q: Notification center bubble. Answer: A: Try Settings, Accessibility, Touch, Assistive touch off.

What is iPad Notification Center?

On iPhone and iPad, Notification Center is a centralized interface for reviewing notifications on your device that have been received from apps or the operating system itself. To view Notification Center while your iPhone or iPad is unlocked, swipe downward from the center of the upper edge of the screen.


1 Answers

I have done an UIViewController which has a timed animation (like a banner ad) going on, and bringing the notification pane down does not stop it until the pane is fully disclosured.

Maybe you have to deal with your animations on -applicationWillResignActive: and -applicationDidBecomeActive:, like pausing and resuming them.

You can receive those notifications directly on your UIViewController (instead of dealing with them on you AppDelegate) by adding the following code to your -viewDidLoad:

// Add observers
[[NSNotificationCenter defaultCenter]addObserver:self
                                        selector:@selector(pauseAnimations:)
                                            name: UIApplicationWillResignActiveNotification
                                          object:nil];  

[[NSNotificationCenter defaultCenter]addObserver:self
                                        selector:@selector(resumeAnimations:)
                                            name:UIApplicationDidBecomeActiveNotification
                                          object:nil];  
like image 156
André Pinto Avatar answered Oct 11 '22 04:10

André Pinto