How to Passing Uiimage from one view controller to

2019-08-30 06:28发布

I Have Two View controllers.

  1. First UIViewController contain one UIImage, when I click "crop" button, go to second view controller I pass the image by push view controller, here I'am cropping my UIImage.

  2. In second UIViewController after cropping my image, clicking "done" button, I need to pass the cropped image to first view.

Problem is when I use pop-view controller, image is not passing.

2条回答
叛逆
2楼-- · 2019-08-30 07:07

Try like this. First view controller should have a property

@property (assign)UIImage *croppedImage;

Second view controller should have

@property (assign)FirstViewController *first;

Before popping set

first.croppedImage = self.image; 
查看更多
冷血范
3楼-- · 2019-08-30 07:14

1)Make a UIIMAGE *variable in first view controllers header.

2)set the uiimage variable from second view controller before popping.

3)POP the second view controller.

If this is not working make a singleton class consisting of uiimage variable

查看更多
登录 后发表回答