Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
onurtekin
7,346 PointsCode before performSegue won't work in a IBAction.
Hi everyone!
I have an UIImageView displaying a "Play" icon in it.
I use a tap gesture recognizer to catch the tap. This gesture recognizer is connected to my HomeViewController with an IBAction.
In prepareForSegue method i prepare some images for the game, so it takes some time like 5 seconds. I want to fade the play button a little, while this time passes. If i manage this i will try to animate the button.
This is my related code:
- (IBAction)beginGame:(id)sender {
self.playButton.alpha = 0.3f;
NSLog(@"%f", self.playButton.alpha);
[self performSegueWithIdentifier:@"beginGame" sender:self];
}
It logs "0.30000", performs the segue but does not change the alpha!
- What seems to be the problem?
- What do you recommend for time taking segues like this one?
Thanks indeed.