Drop object onto view controller icon in IB??

Discussion in 'iOS Programming' started by smirk, Sep 30, 2015.

  1. smirk macrumors 6502a

    smirk

    Joined:
    Jul 18, 2002
    Location:
    Orange County, CA
    #1
    Hi, in Interface Builder I just dragged a UIImageView from the object library onto the view controller icon at the top of the VC window. IB created a small UIImageView image and placed it just above the view controller. What does this do? As you drag the view controller scene around the storyboard, that Image View now moves with it.

    I'm thinking that perhaps it's just a way of grouping UI objects with their view controllers, for those objects that are added programmatically, but Google isn't giving any answers.

    Any ideas?

    Screen Shot 2015-09-30 at 1.35.42 PM.png
     
  2. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    This is a new IB feature that I think is called associated views. You can set an IBOutlet to a view that isn't in the view controller's hierarchy and later addSubview to make it visible. I read about this somewhere but can't seem to find it now.
     
  3. DannyBres macrumors 65816

    DannyBres

    Joined:
    Oct 30, 2007
    Location:
    UK
    #3
    Totally didn't know that, thanks! :)
     
  4. smirk thread starter macrumors 6502a

    smirk

    Joined:
    Jul 18, 2002
    Location:
    Orange County, CA
    #4
    I thought it was something along those lines. I can't find anything about that feature in the documentation, but when I find out what it is I'll post back here.

    Thanks!
     

Share This Page