Skip to content

Ability to set properties using Interface Builder for objects

December 21, 2012

When we use interface builder, not all of the properties will be configurable for view or a control. With Xcode 4.2 release this problem is solved partially.

Lets  say for example,we add a scroll view and a content view on it. IB is meant for fixing everything we know at compile time. Now if we do know the content size of the scroll view we will prefer to set it. But before Xcode 4.2 it was not possible.

Right from Xcode 4.2, a separate section named User defined runtime attributes are available in IB interface. But the project must conform to below requirements: (Thanks to stackoverflow user)

  • Compiling with iOS 5.0.
  • Setting the .xib version attribute to 4.2
  • Running in a simulator or device with iOS 5.0. Older version won’t work.

Image

For the example I have mentioned, the below details thing can be set:

  • Key Path: contentSize
  • Type: Size
  • Value: {width, height}

I doubt it will support the UIEdgeInsets property through run time property interface. I have not tested it.

SOURCE:

http://stackoverflow.com/questions/1135163/how-do-i-use-uiscrollview-in-interface-builder

Advertisements
Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: