Animate loading a XIB with loadNibNamed:

Discussion in 'iOS Programming' started by dbramhall, Oct 27, 2011.

  1. dbramhall macrumors newbie

    Joined:
    Aug 1, 2011
    Location:
    England, UK
    #1
    I am trying to make a UIView (or XIB) slide into view using the loadNibNamed method and I have that working fine however I would like to actual animate XIB coming into the view and thus I was wondering how one would do this.

    Thanks in advance!
    ~Daniel
     
  2. jnoxx macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #2
    animate the controllerPointer.view on the viewDidLoad / ViewWillAppear..
     
  3. dbramhall thread starter macrumors newbie

    Joined:
    Aug 1, 2011
    Location:
    England, UK
    #3
    I have tied that however I've not had any luck with it. Do you have a sample line of code?
     
  4. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #4
    What kind of animation do you want? Alpha animation? frame animation?

    You would normally set this up around the addSubview call. For the alpha animation set the alpha to 0 before the animation block, you could do this in the nib. Then inside the animation block set the alpha to 1. For the frame animation set the frame to something outside the animation block, maybe an offscreen potion. Then change the frame to the final position of the view inside the animation block.
     
  5. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #5
    Perhaps if you were to provide us the code of what you tried, we could help figure out why it didn't work.
     

Share This Page