Objective-c – get the UIButton’s background image

iphoneobjective cuibuttonuiimageviewuiview

I need your suggestions: I want to know how to set the UIButton's backgroundImage image in UIImageView.

i.e. If I touch on the button, the button's background image should be set on UIImageView.

Is it possible? If yes then how?

Best Answer

UIImage *image = self.myButton.currentBackgroundImage;

Apple Documentation for UIButton