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

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -