Skip to content

Instantly share code, notes, and snippets.

@ronnieV3
Created September 27, 2010 18:47
Show Gist options
  • Select an option

  • Save ronnieV3/599581 to your computer and use it in GitHub Desktop.

Select an option

Save ronnieV3/599581 to your computer and use it in GitHub Desktop.
reactorsView = [[SupplyChainReactors alloc] initWithFrame:CGRectMake(0.0, 0.0, 1024.0, 500.0)];
[[self view] addSubview:reactorsView];
[reactorsView release];
reactorsView.alpha = 0;
[reactorsView fadeIn];
currSection = reactorsView;
}
-(void)stopBtnAnimations
{
[reactorAnimation animationStop];
[processorAnimation animationStop];
[manufAnimation animationStop];
[pharmAnimation animationStop];
}
-(void)btnClick:(id)sender
{
for (int i = 0; i < [btnArray count]; i++)
{
[self stopBtnAnimations];
[[btnArray objectAtIndex:i] resetBtns];
if (i == [btnArray count] - 1)
{
[sender buttonClicked];
[[animationArray objectAtIndex:[sender tag]] startAnimation];
}
}
if ([sender tag] == 0) {
NSLog(@"in tag = 0, reactorsView");
[currSection fadeOut];
reactorsView = [[SupplyChainReactors alloc] initWithFrame:CGRectMake(0.0, 0.0, 1024.0, 500.0)];
[[self view] addSubview:reactorsView];
reactorsView.alpha = 0;
[reactorsView release];
[reactorsView fadeIn];
currSection = reactorsView;
} else if ([sender tag] == 1) {
[currSection fadeOut];
NSLog(@"in tag = 1, processorsView");
processorsView = [[SupplyChainProcessors alloc] initWithFrame:CGRectMake(0.0, 0.0, 1024.0, 500.0)];
[[self view] addSubview:processorsView];
processorsView.alpha = 0;
[processorsView release];
[processorsView fadeIn];
currSection = processorsView;
} else if ([sender tag] == 2) {
//send to manufactures
} else if ([sender tag] == 3) {
//pharmacy
}
}
///parent vc above
//subclass uiview
-(void)fadeIn
{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:.5];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
self.alpha = 1.0;
[UIView commitAnimations];
}
-(void)fadeOut
{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:.5];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];
self.alpha = 0.0;
map.alpha = 0.0;
[UIView commitAnimations];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment