In my program, I want the users could touch a picture so that an action will be activated. However, the function IBAction cannot allow me to connect it with the picture. Is there any method that can help me to trigger a function when the users touch the picture? Thank you!
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can activate the User Interaction for that picture, and then detect taps on it and trigger the action based on them. But the simplest solution would be to just put a button behind it, and connect the IBAction to that button. That's what we do in such cases.