Skip to content

Instantly share code, notes, and snippets.

@bdalziel
Last active September 15, 2016 18:41
Show Gist options
  • Save bdalziel/e02f8722af233033a245db4fd2021533 to your computer and use it in GitHub Desktop.
Save bdalziel/e02f8722af233033a245db4fd2021533 to your computer and use it in GitHub Desktop.
-(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