Created
December 7, 2013 15:00
-
-
Save Cellane/7843611 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void)loadImageWithIndex:(int)index toPage:(int)pageIndex{ | |
if (pageIndex == 0) | |
{ | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^ | |
{ | |
UIImage *pom = [UIImage imageNamed:[self.imageNameArray objectAtIndex:(NSUInteger) index]]; | |
dispatch_async(dispatch_get_main_queue(), ^ | |
{ | |
self.imageViewOne.image = pom; | |
if (self.imageViewOne.hidden) | |
{ | |
self.imageViewOne.hidden = NO; | |
[UIView animateWithDuration:0.3 animations:^ | |
{ | |
self.imageViewOne.alpha = 1; | |
}]; | |
} | |
}); | |
}); | |
} | |
if (pageIndex == 1) | |
{ | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^ | |
{ | |
UIImage *pom = [UIImage imageNamed:[self.imageNameArray objectAtIndex:(NSUInteger) index]]; | |
dispatch_async(dispatch_get_main_queue(), ^ | |
{ | |
self.imageViewTwo.image = pom; | |
if (self.imageViewTwo.hidden) | |
{ | |
self.imageViewTwo.hidden = NO; | |
[UIView animateWithDuration:0.3 animations:^ | |
{ | |
self.imageViewTwo.alpha = 1; | |
}]; | |
} | |
}); | |
}); | |
} | |
if (pageIndex == 2) | |
{ | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^ | |
{ | |
UIImage *pom = [UIImage imageNamed:[self.imageNameArray objectAtIndex:(NSUInteger) index]]; | |
dispatch_async(dispatch_get_main_queue(), ^ | |
{ | |
self.imageViewThree.image = pom; | |
if (self.imageViewThree.hidden) | |
{ | |
self.imageViewThree.hidden = NO; | |
[UIView animateWithDuration:0.3 animations:^ | |
{ | |
self.imageViewThree.alpha = 1; | |
}]; | |
} | |
}); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment