ibdesignable

Corner radius not showing on button in storyboard with @IBDesigable/@IBInspectable

不羁岁月 提交于 2019-11-28 05:04:22
问题 I have this custom class for a button. import UIKit @IBDesignable class CustomButton: UIButton { @IBInspectable var cornerRadiusValue: CGFloat = 10.0 { didSet { setUpView() } } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) self.layer.cornerRadius = 10.0 } override func awakeFromNib() { setUpView() } override func prepareForInterfaceBuilder() { super.prepareForInterfaceBuilder() setUpView() } func setUpView() { self.layer.cornerRadius = 10.0 } } But the corner radius is

Failed to render instance of IB Designables

我与影子孤独终老i 提交于 2019-11-28 03:15:06
I have an Objective-C and Swift mixed dynamic framework. And the mixed framework was linked with two pure Objective-C dynamic frameworks. When I tried to mark any class in the mixed framework with IB Designable and using that class in either storyboard or nib, the Xcode always says the instance of it was failed to render. And there was the error message: IB Designables: Failed to render instance of WZUITokenField: dlopen(WZUIKit.framework, 1): Library not loaded: /Library/Frameworks/WZFoundation.framework/WZFoundation Referenced from: WZUIKit.framework Reason: image not found IB Designables:

IBDesignable View Rendering times out

偶尔善良 提交于 2019-11-27 13:35:47
问题 I've been working on an app on and off for a few months starting with the first XCode 6/iOS 8 beta release. One of my favorite features added is live rendering, made possible with the @IBDesignable tag in Swift. I haven't been able to get a single thing to live render. I figured that must have been because it was a beta release, so I decided to wait for the full release to come out to try again. It still failed. I figured then that there might be artifacts from the beta releases in my code,

IB_DESIGNABLE, IBInspectable — Interface builder does not update

[亡魂溺海] 提交于 2019-11-27 03:21:40
I have the following set of code: CustomView.h #import <UIKit/UIKit.h> IB_DESIGNABLE @interface CustomView : UIView @property (nonatomic) IBInspectable UIColor *borderColor; @property (nonatomic) IBInspectable CGFloat borderWidth; @property (nonatomic) IBInspectable CGFloat cornerRadius; @end CustomView.m #import "CustomView.h" @implementation CustomView - (void)setBorderColor:(UIColor *)borderColor { _borderColor = borderColor; self.layer.borderColor = borderColor.CGColor; } - (void)setBorderWidth:(CGFloat)borderWidth { _borderWidth = borderWidth; self.layer.borderWidth = borderWidth; } -

IB_DESIGNABLE, IBInspectable — Interface builder does not update

邮差的信 提交于 2019-11-26 10:27:17
问题 I have the following set of code: CustomView.h #import <UIKit/UIKit.h> IB_DESIGNABLE @interface CustomView : UIView @property (nonatomic) IBInspectable UIColor *borderColor; @property (nonatomic) IBInspectable CGFloat borderWidth; @property (nonatomic) IBInspectable CGFloat cornerRadius; @end CustomView.m #import \"CustomView.h\" @implementation CustomView - (void)setBorderColor:(UIColor *)borderColor { _borderColor = borderColor; self.layer.borderColor = borderColor.CGColor; } - (void