I want to use Matthijs Hollemans' MHRotaryKnob control in my iOS 5 app. I am using a storyboard in Xcode 4.2. MHRotaryKnob
is implemented as a subclass of UIControl
.
I'm unable to replicate the example he provides and thus unable to add the control to my app's view. In the example, his XIB contains a view with an instance of MHRotaryKnob
added to it as a custom control. It loads and runs fine but I can see no way in Xcode to do this for myself. I've tried adding every kind of UIControl
subclass and changing their class in the Identity Inspector, but Xcode keeps changing them right back.
Any ideas?
Thanks
The answer is to add a UIView to the view and change its class in the Identity Inspector, rather than trying to do that with buttons or other UIControls.
When you changed the class of the UIView from the Identity Inspector, don't forget to add initWithCoder:aDecoder to your code, in the custom class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With