[ASMapNode] Remove live map on clearFetchedData, not clearContents

This commit is contained in:
Adlai Holler
2016-02-24 15:20:02 -08:00
parent 439ca172d1
commit de46701ff7

View File

@@ -13,6 +13,7 @@
#import <AsyncDisplayKit/ASInsetLayoutSpec.h>
#import <AsyncDisplayKit/ASCenterLayoutSpec.h>
#import <AsyncDisplayKit/ASThread.h>
#import <AsyncDisplayKit/ASInternalHelpers.h>
@interface ASMapNode()
{
@@ -63,19 +64,23 @@
- (void)fetchData
{
[super fetchData];
if (self.isLiveMap) {
[self addLiveMap];
} else {
[self takeSnapshot];
}
ASPerformBlockOnMainThread(^{
if (self.isLiveMap) {
[self addLiveMap];
} else {
[self takeSnapshot];
}
});
}
- (void)clearContents
- (void)clearFetchedData
{
[super clearContents];
if (self.isLiveMap) {
[self removeLiveMap];
}
[super clearFetchedData];
ASPerformBlockOnMainThread(^{
if (self.isLiveMap) {
[self removeLiveMap];
}
});
}
#pragma mark - Settings