开发者

Getting same UIImageView onto two differant class screens (iOS)

开发者 https://www.devze.com 2023-03-23 11:02 出处:网络
I\'m working on an iOS app and have had some trouble with getting photos from the user\'s photo gallery.

I'm working on an iOS app and have had some trouble with getting photos from the user's photo gallery.

What I need help with doing is getting it so that the user chooses a photo from their photo gallery, and then on the next screen the photo is displayed in an UIImageView.

Unfortunately, while I can do this on one screen, I am having trouble with getting it to work on multiple ones.

I've been trying to import the class files from the first screen into the second but it doesn't seem to do much.

I'm getting user photos through a开发者_如何学运维 similar method to this tutorial (though slightly differant).

I'm fairly new to objective-c, so no doubt I've made some huge mistake somewhere


Pass the selected image from the second view to the first view. Then set the image to the UIImageView declared in first view.

The best way to pass the selected image is 'delegate' method. Declare a protocol. Implement that in first view. Set the delegate to the second view. So whenever an image is selected in second view, pass that to first view thru delegate method.

0

精彩评论

暂无评论...
验证码 换一张
取 消