Search code examples
iosobjective-cuiviewcontrolleruibuttonibaction

when button is selected, there should be a new view loaded


this is my first time in stackoverflow and I'm pretty new to this Objective C language. What would be the best solution in order to load the page in one View Controller?

References are welcome and I really new great coder's help :(

some say when using IBAction, load a NewViewControllers, but some say put modal View on there. However, there should be going back button, so I can't use a modal view

in one single viewController there should be a new view coming out when pressing the button

this is main page when i press the button it moves to image 1


Solution

  • It looks like that the second view is being presented over the first view. What you can do is present second view on you IBAction as

    self.presentViewController(secondViewController, animated: false, completion: nil)
    

    That cross button in second view should then dismiss view through its IBAction as

    dismissViewControllerAnimated(false, completion: nil)