mapbox / Fingertips

Touch indicators on external displays for iOS applications.
BSD 3-Clause "New" or "Revised" License
820 stars 94 forks source link

Problem with view controller-based status bar appearance iOS 7 #12

Closed chipivk closed 10 years ago

chipivk commented 10 years ago

When this plugin is installed and it is using, the viewControllers can't change the status bar style with methods like preferredStatusBarStyle

timarnold commented 10 years ago

Was this resolved? I think I'm having similar issues.

chipivk commented 10 years ago

Hello timarnold, this issue is not been solved yet. I closed it by error. This issue should be reopened.

datalogics-kam commented 10 years ago

It seems related to whether the window of the highest layer has a rootViewController. Echoing the rootViewController into the overlayWindow seemed to fix it for us:

diff --git a/OpenSource/Fingertips/MBFingerTipWindow.m b/OpenSource/Fingertips/MBFingerTipWindow.m
index 16ec00c..5e4738f 100644
--- a/OpenSource/Fingertips/MBFingerTipWindow.m
+++ b/OpenSource/Fingertips/MBFingerTipWindow.m
@@ -187,6 +187,11 @@
 #pragma mark -
 #pragma mark UIWindow overrides

+- (void)setRootViewController:(UIViewController *)rootViewController {
+    [super setRootViewController:rootViewController];
+    [self.overlayWindow setRootViewController:rootViewController];
+}
+
 - (void)sendEvent:(UIEvent *)event
 {
     if (self.active)
incanus commented 10 years ago

Hmm, I just backed the #14 merge out in 660d7cc — not working entirely right for me. Got any time to debug this with me @datalogics-kam?

incanus commented 10 years ago

What I'm seeing is touch events not transferring to the app. They show up visually, but don't actually work. This is on an iPhone in this app as a test: https://github.com/mapbox/MBDesignView

datalogics-kam commented 10 years ago

Okay, I'll take a look at it.

datalogics-kam commented 10 years ago

What I'm seeing so far is that UIKit's patterns (how many times it's accessed, stack traces when accessed) of accessing the rootViewController change when the overlay window has a rootViewController. So nix that patch; I'm looking at subtle changes to the windowLevel instead.

datalogics-kam commented 10 years ago

@incanus Maybe #15 will be the good one this time. I tested it with MBDesignView, and the touch events seem to work. In our app, the status bar still hides appropriately.

incanus commented 10 years ago

Cool, will try to hit this later this week. Thanks @datalogics-kam :+1:

enwar3 commented 9 years ago

Any progress fixing this issue? Still having this issue.. Tried @datalogics-kam's fix and the touch events work, but the status bar doesn't hide appropriately anymore.