title: replace current view with any existing new view
body: <p>In short I would like to call a method from a viewSwitchManager class that contains a method which would switch the current view on display to a different view.</p>
  
  <pre><code>-(void)replaceView:(UIView*)oldSubView withView:(UIView*)newSubView;
  </code></pre>
  
  <p>I am trying to implement the following:</p>
  
  <p>In my project I have 10 views they all have their own .m and .h files. Lets represent each view with number from 1 - 10.</p>
  
  <p>Each view simply contains 9 buttons that would allow the user to click a button and then the app would take the user to the specified view depending on the button clicked.</p>
  
  <p><strong>Example:</strong></p>
  
  <p>So lets say the current view being displayed is: view1.
  on view1 there are 9 buttons being displayed which each correspond to a different view in the app.</p>
  
  <pre><code>[2] [3] [4] [5] [6] [7] [8] [9] [10]
  </code></pre>
  
  <p><strong>NOTE: button1 is missing as that responds to view1 which is the current view so button1 is not needed on this view.</strong></p>
  
  <p><strong>Action:</strong> The user clicks on button 6.
  a method would get called from a separate class called viewSwitchManager would replace view1 the current view, with view6 the new view.</p>
  
  <p>the new view which would be view6 would then display again, buttons that correspont to a different view in the app like so:</p>
  
  <pre><code>[1] [2] [3] [4] [5] [7] [8] [9] [10]
  </code></pre>
  
  <p><strong>NOTE: button6 is missing as that responds to view6 which is the current view so button6 is not needed on this view.</strong></p>
  
  <p>This is what i am trying to achieve. Ive tried different things but i keep getting errors. At one point even a SIGBART error. I've had problems with sending views as parameters, problems with obtaining the current view and replacing it with a new view and so on. I've thought about having a navigation controller but having looked at that looks like a daunting experience and i really dont want to drill down into different layers.
  Just a simple one in one out view system would be great. lol</p>
  
  <p>Can someone please help me as this has taken up a lot of time! Because this problem took most of my time I've even had to repurchase the license just to buy more time which is quite funny.</p>
  
  <p>Any help will be MUCH appreciated. Thank you in advance.</p>