Search code examples
iosxcodeuiviewcontrolleractivationuitabcontroller

How to detect that a ViewController is activated?


This is my second day of learning ios programming with xcode - so this should be an easy quwstion - just that I can't figure it out.

I am using StoryBoards and an UITabViewController with 3 tab items. On the second tab I would like to start the camera, whenever the user selects that tab.

How can I detect that the second view is activated? Is there an event triggered in such cases?


Solution

  • You can also use your ViewController's viewDidLoad method. Do whatever you need to in this method:

    - (void)viewDidLoad
    {
    }