Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to link ibOutlet from subview to custom UIView Class in storyboard xcode

I think this image explains it all. I have a subclass of UIView that I've entered into the class field. I'm trying to connect ibOutlets between the storyboard and class implementation. It's not giving me an error, but it's not working either. Is this another xcode bug, or am I expecting this to work in a way that it won't?

enter image description here

like image 715
nwales Avatar asked Jan 20 '15 18:01

nwales


People also ask

How do I add a custom view to storyboard?

Draw your view using Interface Builder Like you see, the view is the size of a device screen. Fist, select the view on IB object inspector and delete it. Now, add a button to the XIB like you normally do. And custom it like you want.

How do I unlink IBOutlet?

Select the view on the storyboard and then click the Connections Inspector. Then you can click the little x to remove an outlet reference.

What is Xcode IBOutlet?

The type qualifier IBOutlet is a tag applied to an property declaration so that the Interface Builder application can recognize the property as an outlet and synchronize the display and connection of it with Xcode. An outlet is declared as a weak reference ( weak ) to prevent strong reference cycles.


1 Answers

Here is a solution:

1) Type an IBOutlet by hands in your header file, example:

@property (strong, nonatomic) IBOutlet ProgressBarElementView *targetProgressElement;

2) Drag the pin from the code to the element in document outline zone

enter image description here

like image 120
Sergio Avatar answered Nov 06 '22 05:11

Sergio