change color on btn via TAG

BOOL  btntag;

 

– (IBAction)buttonTag:(id)sender{

if (btntag==YES)

{

btntag=NO;

btnColor.backgroundColor=[UIColor greenColor];

}

else

{

btntag=YES;

btnColor.backgroundColor=[UIColor redColor];

}

 

}

 

Advertisements