xcode 6 IB_DESIGNABLE- not loading resources from bundle in Interface builder

前端 未结 6 1162
难免孤独
难免孤独 2020-12-02 17:12

I am trying to make a custom control that updates live in Interface Builder using the new IB_DESIGNABLE option described here.

- (void)drawRect:(CGRect)rect
         


        
6条回答
  •  忘掉有多难
    2020-12-02 17:45

    I've fixed it using the following line of code:

    let image = UIImage(named: "image_name", inBundle: NSBundle(forClass: self.dynamicType), compatibleWithTraitCollection: nil)
    

    After implementing it this way the images show up correctly in the Interface Builder

提交回复
热议问题