uias / Tabman

™️ A powerful paging view controller with interactive indicator bars
https://uias.github.io/Tabman
MIT License
2.87k stars 238 forks source link

App freezing No content loading (TabmanScrollingButtonBar.swift line 93) #325

Closed shejis closed 5 years ago

shejis commented 6 years ago

Please see the below log. It is from crashlytics .In my app Tab title is loading dynamically , sometimes titles are loaded correctly but the no content is loading inside the page . loading indicator is rotating forever , I'm not able to swipe next or previous page. Can you please provide a solution for this.

NB: we have an app with 100 000 users and many of them can't use the app because the app freezes

Fatal Exception: NSGenericException 0 CoreFoundation 0x1ea5b7ef8 exceptionPreprocess 1 libobjc.A.dylib 0x1e9785a40 objc_exception_throw 2 CoreFoundation 0x1ea5b7790 -[NSSingleObjectEnumerator initWithObject:] 3 UIKitCore 0x216e64540 _UIViewEnumerateConstraints 4 UIKitCore 0x216e70960 57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 5 Foundation 0x1eaf5551c -[NSISEngine withBehaviors:performModifications:] 6 UIKitCore 0x216e70818 57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke 7 UIKitCore 0x216e705a0 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] 8 UIKitCore 0x216e70914 57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 9 Foundation 0x1eaf5551c -[NSISEngine withBehaviors:performModifications:] 10 UIKitCore 0x216e70818 57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke 11 UIKitCore 0x216e705a0 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] 12 UIKitCore 0x21735caa8 -[UIScrollView _switchToLayoutEngine:] 13 UIKitCore 0x21761f9dc 45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke 14 UIKitCore 0x21761f8c8 -[UIView(Hierarchy) _postMovedFromSuperview:] 15 UIKitCore 0x21762f60c -[UIView(Internal) addSubview:positioned:relativeTo:] 16 Tabman 0x105c10d0c specialized TabmanScrollingButtonBar.construct(in:for:) (TabmanScrollingButtonBar.swift:93) 17 Tabman 0x105bf871c TabmanBar.clearAndConstructBar() (TabmanBar+Construction.swift:26) 18 Tabman 0x105c16e10 specialized TabmanViewController.config(:didUpdate:) (TabmanViewController.swift:321) 19 Tabman 0x105c16994 protocol witness for TabmanBarConfigHandler.config(_:didUpdate:) in conformance TabmanViewController (TabmanViewController.swift) 20 Tabman 0x105bf7ab4 TabmanBar.Config.items (TabmanBar+Config.swift:50) 28 libdispatch.dylib 0x1e9fef6c8 _dispatch_call_block_and_release 29 libdispatch.dylib 0x1e9ff0484 _dispatch_client_callout 30 libdispatch.dylib 0x1e9fcfb44 _dispatch_main_queue_callback_4CF$VARIANT$armv81 31 CoreFoundation 0x1ea5461bc CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE 32 CoreFoundation 0x1ea541084 CFRunLoopRun 33 CoreFoundation 0x1ea5405b8 CFRunLoopRunSpecific 34 GraphicsServices 0x1ec7b4584 GSEventRunModal 35 UIKitCore 0x216f87558 UIApplicationMain 37 libdyld.dylib 0x1ea000b94 start

shejis commented 6 years ago

@msaps Can you please look into this issue.

msaps commented 6 years ago

@shejis not really sure what's going wrong - do you have any more details on how Tabman is implemented / used to help reproduce it please 😄

shejis commented 6 years ago

@msaps In our App, the Tab's are dynamically allocated ,We are setting Number of tab's and Tab titles dynamically, after fetching Api. After that we try to load content Api's to populate Data, But some times App become Freezed, while we try to load page content,Only the loading indicator rotating forever and all other functionalities does't works. And we uses same view controller for Loading content data.

tab Allocation : func setViewController(){ self.viewControllers.removeAll() var tabBarItems = [Item]() if response.count > 0 { for i in 0 ..< self.responseData.count { tabBarItems.append(Item(title: responseData[i].title)) let contentVC = storyboard.instantiateViewController(withIdentifier: "contentVC") as! contentVC contentVC.data = responseData[i].data viewControllers.append(contentVC) } self.bar.items = tabBarItems }

shejis commented 6 years ago

ezgif com-optimize

msaps commented 6 years ago

@shejis @shibinPP this crash seems to be happening somewhere deep in UIKit, and I can't seem to reproduce it at all. Do you have a demo project which makes this easy to reproduce?

shejis commented 6 years ago

@msaps https://itunes.apple.com/us/app/upcomer-esports/id1136997317?ls=1&mt=8 Here is the link to our application. can you please install and check it .

shejis commented 6 years ago

@msaps did you check the app

msaps commented 6 years ago

@shejis a production app doesn't really help - by demo app I was meaning something where the behaviour can be reproduced and then debugged. My suspicions are this is not a very easy thing to reproduce and it's also something happening in UIKit which makes things a bit more difficult 😅