I am running XCode 5 with iOS 7. I need to dynamically change the height constraint of a UITextView prior to its layout. I have seen many postings stating that this can be done by making an outlet connection from the constraint in IB to the source code. I am trying to make the connection from the constraint outlet in IB to the header file of the owning class, but am unable to make the connection - IB does not "highlight" when I drag over the header file, as it does when making connections from other objects like buttons etc.
Has anyone encountered this before? All help is greatly appreciated.
Right click the view name in the Document Outline. Then click the little x by the referencing outlet. Select the view on the storyboard and then click the Connections Inspector. Then you can click the little x to remove an outlet reference.
Here is a picture of me doing it. I'm control-dragging from the constraint to the header file.
In real life I'm more likely to control-drag to the anonymous category in the implementation file, because I don't want an IBOutlet property to be public. So here's a picture of that too. Sorry, this screen shot does not show the cursor: it is at the bottom end of the stretch line.
You can make an outlet connection by:
Opening the assistant editor and then ctrl+drag your textview to the respective header file. You should see a property created for the textview.
Manually type @property(nonatomic,retain)IBOutlet UITextField *yourTextField;
.Open the assistant editor, drag from the small empty circle(left to the property) to the corresponding control in your view controller.
If you are still not able to make the connection, clean, save your project and then try again.
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