How to access

How can we acesss UIKit viewcontroller component such as a button from another viewcontroller

This idea seems to go against the principle of encapsulation.
A better approach would be for the first ViewController to make a change to a shared Model, which the second ViewController can then respond to.

You don't tell what you want to do precisely.

But if you really need and cannot use robnotyou solution,

  • get an instance vc2 of VC2 in the first VC VC1
  • call vc2.button in VC1

Or use delegation.

How to access
 
 
Q