lib/under_os/ui/navbar.rb in under-os-1.2.1 vs lib/under_os/ui/navbar.rb in under-os-1.3.0
- old
+ new
@@ -22,17 +22,25 @@
def visible
!hidden
end
+ def disable_swipes
+ @_.interactivePopGestureRecognizer.enabled = false
+ end
+
+ def enable_swipes
+ @_.interactivePopGestureRecognizer.enabled = true
+ end
+
def left_button
@left_button
end
def left_button=(view)
@left_button = view
- @_.visibleViewController.navigationItem.leftBarButtonItem = to_navigation_item(view)
+ @_.topViewController.navigationItem.leftBarButtonItem = to_navigation_item(view)
end
def right_button
right_buttons[0]
end
@@ -46,10 +54,10 @@
end
def right_buttons=(views)
views = [views] if views.is_a?(Hash)
@right_buttons = views
- @_.visibleViewController.navigationItem.rightBarButtonItems =
+ @_.topViewController.navigationItem.rightBarButtonItems =
views.map{|v| to_navigation_item(v)}.flatten.compact.reverse
end
private