3

I am developing a swift application, which uses a Walkthrough screen as initial view controller when the app is launched for its first time. I have a skip button there, which should dismiss it when the user clicks on it. The Problem occurs with the action of the button, where I have a code and inside the code I have to assign a name for the first TabBarViewController (the main screen in the app). Please look at the picture: enter image description here

Would you please help me how to give a Class Name to this initial TabBar Controller,I successfully created a Storyboard ID in my case(InitialViewController), but I can't give a class name, look at the picture: enter image description here I have never done this before, I tried to create a new CocoaTouch file and assign a name TabBar Controller, but when I go to the Main StoryBoard and try to type the name inside, it is not recognised. Any ideas how to assign a class name to it ?

Dakata
  • 1,227
  • 2
  • 14
  • 33
  • did you create a class? how do you want to add a name if you did not create a name? – Lu_ Nov 04 '16 at 12:31
  • Any other files on your screen contain a class? did you write anything in swift? try some tutorials – Lu_ Nov 04 '16 at 12:34

2 Answers2

2

It looks like your TabBarController is a regular UITabBarController In that case your code should look like this:

let nextView = self.storyboard?.instantiateViewController(withIdentifier: "InitialViewController") as! UITabBarController
// force unwrapping for brevity
Sergey Katranuk
  • 1,162
  • 1
  • 13
  • 23
0

You must have selected it to be a subclass of UIViewController, however, right now you want it to be a Sub-class of UITabViewController.