 
     public override func drawRect(rect: CGRect) {
         
+        #if !TARGET_INTERFACE_BUILDER
+            // this code will run in the app itself
+        #else
+            if pickerImage1 == nil {
+                renderBitmap()
+            }
+        #endif
+        
         if let img = image {
             img.drawInRect(rect)
         }

import UIKit
import ImageIO

public class ColorPicker: UIView {
    
    private class PickerImage {
        var provider:CGDataProvider!

        
    }
    
    public override func prepareForInterfaceBuilder() {
        self.renderBitmap()
    }

}
