0
votes

Ok, i've got a view controller with a segmented control and in the container view there is a PFQueryTableviewController.

The reason for all of this is aesthetics and won't be changed i know this can be done by making a tableview in the same view controller, but PFQueryTableViewController doesn't work like this so humour me.

Currently have a segmented control assigning an integer for each segmented choice.

Is there a way when i click on segment control to reload the table view and send the new integer, or a better way of sending integers to the container.

currently using

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {

var detailScene = segue.destinationViewController as DictionaryTableViewController

detailScene.segmentChoice = segmentChoice

}

which only works when the page is loaded, any help would be really appreciated thank you in advance.

1

1 Answers

0
votes

If you created your container view controller from a storyboard, you can should create an property in your parent view controller that refer to you container view controller.

@IBOutlet weak var detailScene: PFQueryTableviewController!

That way, you can send the segmented control index like this :

self.detailScene.segmentChoice = segmentChoice