Add setNeedsDataFetch method to queue off screen fetchData calls

This commit is contained in:
Levi McCallum
2016-01-27 14:52:37 -08:00
parent f696eb7476
commit ec7a3599bd
4 changed files with 48 additions and 3 deletions

View File

@@ -29,6 +29,33 @@ inline BOOL ASInterfaceStateIncludesFetchData(ASInterfaceState interfaceState)
return ((interfaceState & ASInterfaceStateFetchData) == ASInterfaceStateFetchData);
}
inline BOOL ASInterfaceStateIncludesMeasureLayout(ASInterfaceState interfaceState)
{
return ((interfaceState & ASInterfaceStateMeasureLayout) == ASInterfaceStateMeasureLayout);
}
inline NSString * _Nonnull NSStringFromASInterfaceState(ASInterfaceState interfaceState)
{
NSMutableString *result = [NSMutableString stringWithString:@"{ "];
if (interfaceState == ASInterfaceStateNone) {
[result appendString:@"No state"];
}
if (ASInterfaceStateIncludesMeasureLayout(interfaceState)) {
[result appendString:@"MeasureLayout"];
}
if (ASInterfaceStateIncludesFetchData(interfaceState)) {
[result appendString:@" - FetchData"];
}
if (ASInterfaceStateIncludesDisplay(interfaceState)) {
[result appendString:@" - Display"];
}
if (ASInterfaceStateIncludesVisible(interfaceState)) {
[result appendString:@" - Visible"];
}
[result appendString:@" }"];
return result;
}
NS_ASSUME_NONNULL_BEGIN
ASDISPLAYNODE_EXTERN_C_BEGIN