1

i need to know how access another viewController from specific viewController.

it's my code

class TabViewController: UITabBarController, UITabBarControllerDelegate  {

var timeLineViewController : TimeineViewController = TimeineViewController()

override func viewDidLoad() {
    super.viewDidLoad()
    timeLineViewController.postList.alpha = 1.0
    // Do any additional setup after loading the view.
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

 }
Miller Mosquera
  • 119
  • 4
  • 14

2 Answers2

0

Well, there are a few things you need to do:

1) set up variables that can be manipulated by another class

2) in the other view controller that you want to control it, create an instance of the class you want to be manipulated

3) once you have that instance, you can modify it at will

4) present the view controller

Example:

 let tableViewController = yourTableViewController()
 tableViewController.yourBoolProperty = true

 //perform any showing action you want 
gigadude7
  • 20
  • 4
0

Basically you can use segue to connect/ pass data between controllers just follow the links that i posted. It may help you to understand how to passing or accessing data...

If you want to pass data from VC to VC follow the link

https://www.youtube.com/watch?v=guSYMPaXLaw.

If you want to Send data from TableView to DetailView follow this link

Send data from TableView to DetailView Swift

look for more tutorials if you want. Because you got nothing in your code....

Community
  • 1
  • 1
Joe
  • 8,868
  • 8
  • 37
  • 59