remirobert / Dotzu

:iphone::eyes: In-App iOS Debugging Tool With Enhanced Logging, Networking Info, Crash reporting And More.
MIT License
1.8k stars 141 forks source link

Adding to project freezes user input, does not show dotzu floating button #13

Closed jonchui closed 7 years ago

jonchui commented 7 years ago

It's weird because we're using this in 2 different projects.

The first one is an older project that has been in development for 2 years. When i follow instructions to add to the AppDelgate via Dotzu.sharedManager.displayWindow(), it 1) does not show dotzu manager 2) seems to freeze all user input on the screen (UI interaction works, b/c i set an animation and that still works, just all user input is gone.

On a newer project, that i just created last week, calling Dotzu.sharedManager.displayWindow() works.

How can i debug what the issue is? It looks like when i hit Xcode's Debug | Print View Hierarchy I see:

image And when i print of description of UIWindow i get:

po 0x7fe6fc40d450 <UIWindow: 0x7fe6fc40d450; frame = (0 0; 414 736); gestureRecognizers = <NSArray: 0x6180000527e0>; layer = <UIWindowLayer: 0x618000028640>>

After casting it:

(lldb) expr -l Swift -- print($nav) <UIWindow: 0x7fe6fc40d450; frame = (0 0; 414 736); gestureRecognizers = <NSArray: 0x6180000527e0>; layer = <UIWindowLayer: 0x618000028640>>

I debug, and everything seems right:


0.0
(lldb) expr -l Swift -- print($nav.screen)
<UIScreen: 0x7fe6fc700280; bounds = {{0, 0}, {414, 736}}; mode = <UIScreenMode: 0x61000003f720; size = 1242.000000 x 2208.000000>>
(lldb) expr -l Swift -- print($nav.makeKeyAndVisible)
(Function)
(lldb) expr -l Swift -- print($nav.rootViewController)
Optional(<OrdersViewLite.NavigationController: 0x7fe6fd00fa00>)```
remirobert commented 7 years ago

there is something very wrong. it's like your user experience is on the Dotzu UIWindow.

See a correct structure to work with Dotzu :

screen shot 2017-03-06 at 22 17 40

Maybe you are doing some stuff with the UIWindow, and you are selecting the Dotzu's one.

jonchui commented 7 years ago

Ah, figured it out: Turns out the old project hadn't called "

self.window?.makeKeyAndVisible() in AppDelegate#didFinishLaunching

Hm... i guess if you don't call it, and no other window calls it, apple just assumes you're the only window and makes you key & visible

remirobert commented 7 years ago

Thanks for letting me know.