1.9.6
AsyncDisplayKit 1.9.6 has an awesome new load-ahead and display-ahead range controller, accelerating load time further without impacting main thread stalls. There are a a few significant new features, like ASVideoNode and tvOS build support, but performance accelerations and a few important bug fixes are the most broadly applicable reasons to upgrade.
Users on 1.9.5 should upgrade as soon as possible, as the release from last week has an issue where the preloading ranges may delay triggering until content is beginning to come onscreen. A text rendering edge case — partial clipping when using NSParagraphStyle centering — is also fixed.
Cocoapod Specs:
http://cocoapods.org/pods/AsyncDisplayKit
Total Downloads: 131,004
Dev-installs this week: 17,359
Apps: 1,771
Release Specs:
95 commits from 13 contributors
124 files changed with 5,386 lines added and 246 lines deleted
New:
-
ASRangeController is substantially updated, with a simpler, clean and well-commented new implementation that is more accurate and results in even faster dispatch of fetch-ahead and display-ahead. The new version has more advanced behavior with nested ranges, like an ASPagerNode containing ASTableNodes, and automatically minimizes memory usage while aggressively prioritizing the visible content area's interface state changes so any direction of scrolling is fast.
This is one of the most important classes in AsyncDisplayKit, leveraging abstractions like ASInterfaceState to allow it to drive the super-valuable interface change methods: -layoutSpecThatFits:, -fetchData, -display, and -visibilityDidChange:.
-
tvOS support is coming to AsyncDisplayKit! 1.9.6 builds for tvOS, preserving almost every aspect of its functionality. This is being actively developed by the community, and the next step is improved integration with the UIFocus APIs.
-
ASVideoNode is a new class that exposes a relatively full-featured API, and is designed for both efficient and convenient implementation of embedded videos in scrolling views. It supports autoplay (and pause) when items become visible, even if they are in a nested scroller (e.g. an ASPagerNode containing ASTableNodes). It also offers asynchronous downloading and decoding of a thumbnail / placeholder image if a URL is provided, but if unavailable, will use hardware frame decoding to display the first video frame. ASVideoNode is not yet optimized and should be used with caution for production purposes. Interested clients should follow developments in master, as performance in scrolling views with many ASVideoNodes will be improved in the next several weeks.
-
New Example Apps, including two ASVideoNode apps and a Groupon-like CatDealsCollectionView (including iPad support)
API improvements or extensions
- ASMapNode now uses MKMapSnapshotOptions as its primary specification format for map details. Among other things, this allows specifying 3D camera angles for snapshots loaded automatically and asynchronously while scrolling, with seamless transitions to an interactive map.
- ASButtonNode now supports state-changing background images. It also now offers methods that allow more convenient usage than creating attributed strings — title NSString, UIFont, and UIColor. Enabled layerBacking for subnodes to significantly lighten main thread impact relative to UIButton (though async preparation is the bigger win).
- -[ASCellNode initWithViewControllerBlock:] makes paging content views easier than ever on iOS. ASPagerNode has easy-to-tune parameters for how many controllers to fetch and display, and calls the UIViewController lifecycle methods. Much easier to build a fast and simple pager than with UIPageViewController's unusual API.
- ASEditableTextNode is now scrollable, for long fields of text that are larger than the sizeRange or constrainedSize allow.
- ASNetworkImageNode now offers an @optional delegate method to receive NSError objects if a download fails.
- ASDisplayNode now offers a subclass override method called -calculatedLayoutDidChange. This ASDisplayNode+Subclasses.h method is called immediately after the ASLayout is set on a node, which is typically on a concurrent queue. ASTextNode uses this to account for smaller-than-constrained-size text, which affects centering behavior (but incidentally does not appear to impact left-aligned or RTL behavior).
Key bug fixes in this release:
- Fixes a regression from 1.9.4 where ASTextNodes would incorrectly handle an NSParagraphStyle for centering. Depending on the true width of the text relative to the available constrained space, mismatches in the centering calculation could cause the text to shift by half the width difference (and become partially clipped). This is fixed via structural improvements in the efficiency and call behavior of ASTextNode and ASTextKitRenderer.
- Fixes a regression from 1.9.5 where preloading data or display may be delayed until the element comes onscreen. This is fixed by the new range controller.
- Workaround for an Apple CoreGraphics bug in iOS 9 / Mac OS X 10.11 El Capitan clients who provide the same UIImage reference to many ASImageNodes may find that the system can deadlock when calling drawInRect: with the same object on different threads. This is prevented with @synchronized on the image for just the draw call, which was profiled to be absolutely negligible in performance impact on an iPhone 4 with iOS 7.1.2. The bug is a very serious one for Apple, and has been causing many apps to hang, including the latest version of Pro apps like Adobe Premier on OS X.
Full commit list here: 1.9.5...1.9.6
As always, email [email protected] with any questions or comments. Thanks for following the development of our framework — I hope the community continues to bring you advanced and exciting software technology for years to come!