Last active
September 15, 2016 18:41
-
-
Save bdalziel/e02f8722af233033a245db4fd2021533 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)wrangleData { | |
NSMutableArray *wrangledData = [[NSMutableArray alloc] init]; | |
// Read model data into blocks and into wrangledData | |
// Communicate service state | |
switch (self.teamService.serviceState) { | |
case ASPServiceStatePreLoad : | |
case ASPServiceStateLoading : | |
[wrangledData addObject:[[ASPWrangledDataBlock alloc] init:ASPWrangledDataBlockTypeLoading]]; | |
break; | |
case ASPServiceStateLoadError : { | |
ASPWrangledDataBlock *block = [[ASPWrangledDataBlock alloc] init:ASPWrangledDataBlockTypeLoadError]; | |
[block setError:self.service.preservedLoadError]; | |
[wrangledData addObject:block]; | |
break; | |
} | |
case ASPServiceStateComplete : | |
[wrangledData addObject:[[ASPWrangledDataBlock alloc] init:ASPWrangledDataBlockTypePlaceholder]]; | |
break; | |
} | |
} | |
[self setWrangledData:wrangledData]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment