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.
Most UITableViewCell properties aren't useful in conjunction with
ASCellNode -- the system's UIView properties are unsupported for
performance reasons, and properties that configure them (e.g., content
indentation) don't affect custom node hierarchies. This patch adds
support to _ASTableViewCell for the properties that *are* useful.
r=scottg
Highlight target layers with non-zero bounds.origin exhibited broken
text highlighting behavior. Highlights would appear offset by the
layer’s bounds.origin, and would not align with their target text. This
most often appeared in UIScrollView, where highlights would appear
incorrectly offset once the scroll view was scrolled. Fix by accounting
for bounds.origin in the calculations of the text overlay highlight
rects.
(1) We can't size nodes without a delegate, and if our owning controller
has been deallocated, our delegate will be nil. Handle this more
gracefully.
(2) Our teardown code needs to be executed on the main thread, but it's
conceivable that we might hit refcount 0 on a background queue. Force
deallocation to occur on the main thread.
Closes#27.
ASImageNode and ASHighlightOverlayLayer were both using
[[UIScreen mainScreen] scale] directly. Bad. No cookie. Use
ASDisplayNodeScreenScale() instead.
(Also, regenerate Xcode project with Xcode 6 and current CocoaPods.)