I have the following class definition and IBAction. The class is the class I am using for root / first / master "page" in my UIPageViewController set. (i.e. the master UIPageController that all the other controllers are loaded into.)
import UIKit
class MasterPageViewController: UIViewController, UIPageViewControllerDataSource, SideBarDelegate {
var iobj_NearbyPlacesViewController: NearbyPlacesViewController!
var iobj_PageViewController: UIPageViewController!
var ia_StoryBoardNames: [String] = ["NearbyPlacesViewController","NearbyCitiesViewController", "SearchViewController"]
var ii_CurrentPageIndex: Int = 0
@IBAction func btnMenuClick(sender: AnyObject)
{
gobj_sideBar.showSideBar(!gobj_sideBar.isSideBarOpen)
}
I have double checked and ensured the button on my storyboard scene is linked to the action and it is. The challenge is that when I click on the button, the action is never called. I have tried adding a new button to the scene and linking that up to a different action event and that does not get called either. Any idea of what I am doing wrong and how I can get this to work? Please let me know.
So it turns out I was just being very silly. Everything was set up 100% correct with regard to actions etc. The problem was that I made the background of the child / content page clear and did not see its actual boundaries when it was loaded. As it turns out, once I changed the background color to white so I could see that I it was actually loading completely over top of the master view controller. Thus, although I could see the button I wanted to click because that content page had a clear background, I was actually clicking on the transparent background of the content page and not actually on the button in the master page. Once I resized the content page to not overlap the button area of the master page, everything worked fine. Thanks for all the help.