Search code examples
iosiphoneswiftxcodeibaction

How can i use the IBAction botton to go to the next storyboard using Swift?


Im trying to write a function that will take me from on storyboard to the next using a button. I am new to iOS app dev and Swift. I have a button with this IBAction but im not sure how to connect pages. Meaning going to the next page using a button. thanks.

    @IBAction internal func nextBtn(_ sender: Any)

}


Solution

  • No need to write any code for this, it can all be done in Interface Builder. Create a storyboard reference in IB, and control-drag from the “next” button to the storyboard reference. Done.

    There is a nice tutorial with pictures here: https://medium.com/@wilson.balderrama/how-to-segue-between-storyboards-86c582f976f7