Tab Bar - code execution

Discussion in 'iOS Programming' started by Bloubul, Aug 20, 2011.

  1. Bloubul macrumors newbie

    Jul 9, 2011
    I am working on a tab bar application. For one of the tabs I required a full screen camera preview. Hiding the tab bar left a white space at the bottom so I ended up using an additional new xib / UIViewController for that purpose using the ViewDidLoad method. So when the user selects the specific tab the one xib calls the other one.

    However the code only executes once as it is currently using the viewDidLoad method. Is there a way to load the code every time someone selects the tab calling the first xib which in turns call the xib I am using for preview layer. I hope this doesn't sound too confusing.

    Thanks in advance for any assistance.
  2. jnoxx macrumors 65816


    Dec 29, 2010
    Aartselaar // Antwerp // Belgium
    Have u bothered checking into the documentation of UITabbarController, there is a method there to check what tab is clicked, you can do an index check, or check what tab is clicked by name. When that is triggered, pop up a modalviewcontroller with the camera (no need to hide the tabbar, since it overlaps it anyways, if you use the presentModalview fullscreen..)
  3. ethical macrumors 68000

    Dec 22, 2007
    No expert, and not sure I fully understand the post, but what about the viewWillAppear method?

Share This Page