I have a UISegmented control, which act as a tabs. When a tab is clicked I wanted to change the view to another page.
Essentially at the moment I have two views each have their own segment control which switches from one view to the other and vice versa.
If I use PresentModalViewController I continually adding the view to the stack each time the user changes the uiSegment which isn't good.
I want to set the current view to a new view. but at the same time ensure that if I call dismiss I can do back a view My applicantion is structure like so:
[Main Window] --> [VC shows table of items] -->
|--> [VC with Segment control View 1]
| (swap between)
|--> [VC with Segment control View 2]
so in both the views I would have for instance:
View1:
partial void Tabs_Changed (UISegmentedControl sender)
{
if( btnTabs.SelectedSegment == 1) {
View2 view2 = new View2(); //load view 2
this.PresentModalViewController(view2,false);
}
}
View 2:
partial void Tabs_Changed (UISegmentedControl sender)
{
if( btnTabs.SelectedSegment == 0) {
View1 view1 = new View1(); //load view 1
this.PresentModalViewController(view1,false);
}
}
But this is making the app unpredictable presumably cause I'm constantly stacking up views?
Please help.
Jason