I’ve placed an image in my UIView with IB.
How do I move this image around, resize it, etc programmatically? I cannot figure out how to reference it from my code.
Thanks a zillion.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to make it an
IBOutlet.So in your
viewController, or whatever you are loading from thenib, declare it like this:Also, in the actual
nib, you must connect theFile's Ownerobject to theUIImageViewin your file by right-clickingFile's ownerand dragging the correct outlet name (in this case,myImageView) onto the correctUIImageViewinstance in yournib.Now when you load one of the objects using the
nib, myImageView will point to the initializedUIImageView, or whatever else you have.