in your setPageViewController() function, which you use addSubview() to add the UIPageViewController view to the ViewController view. This will put the view on top of all other views.
Basically, you have two options to avoid this. Or inserting it as the very first view, using
self.view.insertSubview(pageViewController!.view, atIndex: 0)
or below a certain species using
self.view.insertSubview(pageViewController!.view, belowSubview: self.headerbar)
That should do the trick.
Update
Also ensure that user interaction is enabled for the container view. Interface Builder has a setting, but you can also do this in code:
self.headerbar.userInteractionEnabled = true
source share