简体   繁体   中英

How to detect UIButton background image change?

I work on iOS 8 with objective C on Xcode. I need to create two viewControllers. First: button with background image that is changed to some random image, and go to second controller. Second: Present button image name

Both view Controllers are created but, i need to know about :

1.How to detect that the image on the button is changed on the First view ,if i now on Second viewController?

2.How to pass the file name to the second viewController ?

you can get back the image with :

[self.button currentImage]

(also works with currentBackgroundImage/Title/TileColor... rtfm ;))

To pass data to your second view controller many options exists, you can use "prepareForSegue" and set you next view button/NString whatever :)

Good Luck ;)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM