Skip to content

Instantly share code, notes, and snippets.

@dchohfi
Created April 27, 2015 17:19
Show Gist options
  • Save dchohfi/85456ef9c2d5656d3023 to your computer and use it in GitHub Desktop.
Save dchohfi/85456ef9c2d5656d3023 to your computer and use it in GitHub Desktop.
O que dizer desse código que mal conheço mas já curto pakas?
- (void)changeDots {
switch (self.hasDots) {
case NO:
[_viDots removeAllActions];
[_viDots runAction:[NPPAction fadeOut]];
break;
case YES:
[_viDots removeAllActions];
[_viDots runAction:[NPPAction fadeIn]];
default:
break;
}
}
@fabianoaquino
Copy link

  • (void)changeDots {
    [_viDots removeAllActions];

    if (self.hasDots == YES) {
    [_viDots runAction:[NPPAction fadeIn]];
    } else {
    [_viDots runAction:[NPPAction fadeOut]];
    }
    }

@joaofranco
Copy link

bool recursiveCall = NO;

- (void)changeDots {

  if(recursiveCall == NO)
  {
      // call again to make sure
      recursiveCall = YES;
      changeDots();
      return;
  }

  int checkValue = 000;
  if (self.hasDots == NO)
    checkValue = checkValue + 10;

  if (self.hasDots == YES)
    checkValue = checkValue + 20;

  if(checkValue >= 10)
  {
    [_viDots removeAllActions];
    if(checkValue / 10 == 1)
        [_viDots runAction:[NPPAction fadeOut]];
    if(checkValue / 10 == 2)
        [_viDots runAction:[NPPAction fadeIn]];

  }
  else
  {
    // do nothing
  }

}

@brunokoga
Copy link

Legend

@evansantos
Copy link

- (void)changeDots{
  [_viDots removeAllActions];
  self.hasDots ? [_viDots runAction:[NPPAction fadeOut]] :  [_viDots runAction:[NPPAction fadeIn]];
}

@leodutra
Copy link

"Problems with this Web page might prevent it from being displayed properly or functioning properly. In the future, you can display this message by double-clicking the warning icon displayed in the status bar."

"Object expected on line <end of your code + 200>".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment