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
I also had the same problem : looking at this answer and following WWDC 2014 whats new in Interface Builder. I solved it like that:
- (void)prepareForInterfaceBuilder{
NSArray *array = [[NSProcessInfo processInfo].environment[@"IB_PROJECT_SOURCE_DIRECTORIES"] componentsSeparatedByString:@":"];
if (array.count > 0) {
NSString *str = array[0];
NSString *newStr = [str stringByAppendingPathComponent:@"/MyImage.jpg"];
image = [UIImage imageWithContentsOfFile:newStr];
}
}