user3428151
user3428151

Reputation: 451

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 ?

Upvotes: 1

Views: 172

Answers (1)

Alexandre Arrighi
Alexandre Arrighi

Reputation: 51

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 ;)

Upvotes: 1

Related Questions