skip to Main Content

I’m a newbie in coding and I’m learning Swift to develop my first application.

I’m following this YT tutorial trying to integrate a SideMenu :
https://www.youtube.com/watch?v=iq-tWW45Vhk

The fact is that after I added the @IBAction func into my code like this:

ViewController code

I do not find the received action I create in the code like in the video at 4:47

Youtube Screenshot

I found out that this appears only in my first ViewController (the blue screen) of my StoryBoard but I want the function to appear on the top right view controller Storyboard

Can someone help me?

Thx

Julien

2

Answers


  1. I found out that this appears only in my first ViewController (the blue screen) of my StoryBoard but I want the function to appear on the top right view controller Storyboard

    You need to put the action in the view controller class where you want it to appear. If it’s showing up somewhere else, it’s in the wrong class.

    Login or Signup to reply.
  2. For all viewControllers in story board you have to create separate swift class files, and create it’s IBAction outlet in it’s class file.

    add viewController class here : enter image description here

    after this you will be able to create IBOutlet and IBActions in that class.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search