Live Render IBOutlet Connected Subviews Via IBInspectable Properties

后端 未结 1 1272
陌清茗
陌清茗 2021-01-08 00:56

I\'m using storyboards for the first time in iOS 8 and so far have been loving the live rendering aspect of things on the storyboard. However, I seem to have hit a snag in g

相关标签:
1条回答
  • 2021-01-08 01:31

    Unfortunately you can't see IBOutlet objects in interface builder for your custom views which are marked as IBDesignable. If you want to see your outlets in interface builder, you have to use regular variables instead IBOutlet and you have to create your objects programmatically.

    Also please note that, if you need to change something from interface builder for your objects, you have to define your properties as IBInspectable. Currently following variables types are valid for IBInspectable:

    Bool, CGFloat, CGPoint, CGRect, CGSize, NSInteger, NSString, UIColor, UIImage

    I hope this answer is adequately clear for you.

    Edit: I found following article which is describing a way how to do what you need:

    http://justabeech.com/2014/07/27/xcode-6-live-rendering-from-nib/

    2nd Edit: I tried the article and it works. Now I can see my outlets on interface builder

    0 讨论(0)
提交回复
热议问题