objective c - iOS: Changing the background image on tap gesture -


i have tap gesture set , when tap in simulator nslog fires, i'm sure it's hitting it:

@implementation coolcontroller  - (void)viewdidload {     [super viewdidload];     ...      uitapgesturerecognizer *backgroundtaprecognizer = [[uitapgesturerecognizer alloc] initwithtarget:self action:@selector(backgroundtapped)];     backgroundtaprecognizer.numberoftapsrequired = 2;     [self.view addgesturerecognizer:backgroundtaprecognizer]; }  - (void) backgroundtapped {     nslog(@"cool"); // <-- fires when tap twice     [self.view setbackgroundcolor:[uicolor colorwithpatternimage:[uiimage imagenamed:@"table-2"]]]; } 

however, image in background doesn't change. need call method update ui?

try this

  • (void) backgroundtapped: (id)sender

Comments

Popular posts from this blog

swift - Button on Table View Cell connected to local function -

dns - Dokku server hosts two sites with TLD's, both domains are landing on only one app -

c# - ajax - How to receive data both html and json from server? -