ASRangeController previously enqueued display of individual nodes by
adding their views to the hierarchy, wrapping each `-addSubview:` call
in an explicit CATransaction to force displays to occur in order. This
hack is no longer necessary -- kill it.
ASDisplayNodes now have an overidable method -placeholderImage that lets you provide a custom UIImage to display while a node is displaying asyncronously. The default implementation of this method returns nil and thus does nothing. A provided example project also demonstrates using the placeholder API.
These weren't correctly handling teardown: nilling the `asyncDelegate`
created a new selector-forwarding NSProxy that crashed and burned
because there was nowhere to forward to. Nil everything correctly.
Tentatively fixes#121.
Postpone manual display until a future release when it can be called on any thread. Provide the current node manual display logic as a category on ASDisplayNode only available for ASRangeController. Deprecate -displayImmediately.
On iOS 7, NSURLSessionTask is actually a __NSCFURLSessionTask (private class) and our NSURLSessionTask category to add the associated object asyncdisplaykit_metadata was crashing on iOS 7 stating that there was no method. This commit changes the category to extend NSURLRequest as well as change NSURLSessionTask to NSURLSessionDownloadTask.
Use ASBasicImageDownloader by default -- you can now do...
ASNetworkImageNode *imageNode = [[ASNetworkImageNode alloc] init];
imageNode.URL = [NSURL URLWithString:@"..."];
[self.view addSubview:imageNode.view];
...and it'll do the right thing.
Add a `usleep(1.0 * USEC_PER_SEC)` delay to ASBasicImageDownloader and
slowly scroll through the Kittens sample project. Without this patch,
you'll see that images only start downloading after their purple
placeholders appear onscreen. With it, images can download and render
before you scroll them onscreen, thanks to the working range.
ASDISPLAYNODE_DELAY_DISPLAY unconditionally delays *all* attempts to
execute display blocks, even those that have been cancelled. Fix that.
The DELAY_DISPLAY debugging tool is intended to simulate the effect of
expensive draw calls -- it lets you test your app's behaviour under
conditions potentially even worse than an iPhone 4. Unfortunately, the
current simulation is unusably incorrect, as can be demonstrated by
repeatedly scrolling up and down in the Kittens example project.
ASRangeController enqueues asynchronous display of ASTableView cell
nodes when they enter the working range, and suspends their display when
they exit. On a slow device, this performs as desired, limiting
expensive display computation to the space of the working range. In
the DELAY_DISPLAY simulation, the suspended displays are as expensive as
the executed ones, so ASRangeController becomes unusably slow.
Rename the ASDisplayNode property to match its _ASDisplayLayer
counterpart -- `displaySuspended` is more succinct and is a more
plausible name for a Cocoa BOOL property.
This is a remnant from before `willAppear` and `didDisappear` were
renamed to better reflect their hierarchy-change status (being added to
the hierarchy != being visible). May be useful for turians.
* Reorganise and rename `_flags` for clarity and consistency.
* Remove ambiguity between `implementsDisplay` and `hasClassDisplay`.
* Delete useless `hasWillDisplayAsyncLayer` check -- make it a simple
subclass override point, as with `didDisplayAsyncLayer:`.
* Minor comment cleanup.
Added a sample project that will demonstrate how to manually display nodes. Removed the UIWindow hack that coupled display of nodes with Core Animation transactions.
This is a simplistic, NSURLSession-based downloader object that
implements ASImageDownloaderProtocol and can be used with
ASMultiplexImageNode and ASNetworkImageNode.
(Closes#115. NSURLSession should suffice for most usecases, and this
code should provide a good jumping-off point for a more-complex
implementation.)
Initial open-source release of ASMultiplexImageNode. Documentation and
example code forthcoming.
Note: ASMultiplexImageNode requires Xcode 6 to compile. Tests are now
compiled against the iOS 8 SDK and run on iOS 7.1 and iOS 8.