Start downloading images when multiplex node is displayed

fixes #178
This commit is contained in:
Ryan Nystrom
2015-01-07 16:18:48 -08:00
parent bacfcbd24d
commit ae1349eb16
3 changed files with 25 additions and 44 deletions

View File

@@ -50,7 +50,7 @@
_textLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:22.0f];
// tap to reload
UITapGestureRecognizer *gr = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(start)];
UITapGestureRecognizer *gr = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(reload:)];
[_textLabel addGestureRecognizer:gr];
@@ -92,10 +92,14 @@
_textLabel.text = @"loading…";
_textLabel.userInteractionEnabled = NO;
_imageNode.imageIdentifiers = nil;
_imageNode.imageIdentifiers = @[ @"best", @"medium", @"worst" ]; // go!
}
- (void)reload:(id)sender {
[self start];
[_imageNode reloadImageIdentifierSources];
}
#pragma mark -
#pragma mark ASMultiplexImageNode data source & delegate.