1

I am having difficulty figuring out how to set up my UINavigationController to get the result I want. Most succinctly, I want to mimic the navigation of the app BriefMe.

Specifically, I want:

  • a main view (v#1) that segues to a new view controller (v#2) with an embedded UIWebView
  • to permanently hide/disable the navigation bar and toolbar on v#1, but I do want a toolbar on v#2 (ideally which shows/hides on swipe -- I figure this can be solved with a UIGestureRecognizer if not through the NavController's hide on swipe/tap property)
  • v#2 to segue back to v#1 on a swipe from the left edge of the screen, just like the default NavController behavior, shown here.

enter image description here

I've run into two problems with my attempt to set this up:

  1. I can't permanently hide the navigation/toolbar on v#1 while leaving v#1+#2 embedded in a NavController. Without the NavController, I don't retain the swipe-to-segue functionality when v#2 is at the top of the stack
  2. Allowing the WebView to scroll disables/'intercepts' the swipe-to-segue functionality. My only thought is to disable interaction with the WebView, place the WebView in a ScrollView, and allow only vertical scrolling on the ScrollView. Will this allow the swipe-to-segue to work?
JD Angerhofer
  • 148
  • 1
  • 13

1 Answers1

0

If I understand your questions correctly:

  1. We’re still popping a controller from the stack during the transition. We just add the navigation bar as a subview of the controller’s view at the top of the stack and then set up the back event manually.

  2. We ended up using a version of the answer specified here. We added an extra invisible thin column overlaying the left side of the webview because some webviews were still giving us trouble.

Hope that helps!

Community
  • 1
  • 1
Hari Ganesan
  • 532
  • 4
  • 18