I am writing a to-do list application to learn how to quickly develop iOS. I had a settings button in the navigation bar, on the right, and whenever someone clicked the button above the table view, they could add a new item to their list. This causes the Cancel button to appear on the left side of the panel and the Add button to appear on the right side. However, when this is done, these buttons disappear, so I programmatically re-create the settings button with a call to the function that should call the session.
self.navigationItem.rightBarButtonItem = UIBarButtonItem(image: UIImage(named: "modify"), style: UIBarButtonItemStyle.Plain, target: nil, action: Selector("showSettings:"))
This is the code that creates the button on the navigation bar (and it is actually created)
func showSettings(sender: AnyObject?) { print("segueShouldBeDone!") performSegueWithIdentifier("showSettings", sender: sender) }
And this is a function that should call segue (I added a print to see if it was even called, and itβs not).
I had the same problem elsewhere in my code, but I refused to fix it because it was not so important for me. But now it interferes with the application, so I would like to know how to fix it.
Any help would be great.
source share