* Add experiment to skip waiting until all updates of collection/table view are committed in -accessibilityElements
The wait was introduced in #1217 which blocks the main thread until updates are proccessed. We suspect this causes perf regressions accross the app and need to confirm this via an experiment.
* Add option to skip default behavior of ASCellLayoutMode
* Fix unit test
* Fix unit test in another way
* Remove import
* Minor change
* Add ASCellLayoutModeSyncForSmallContent
* Update unit tests
* Remove unnecessary change
* Remove unnecessary changes
As of today, ASRangeController doesn't manage the interfaceState for supplementary nodes. This bug was introduced with a refactoring of this code a couple months ago.
With this change, the supplementary nodes will automatically enter each interfaceState bit when they are added to a view hierarchy.
* Wrap supplementary node blocks to enable resizing them.
Most ASCellNodeBlocks are wrapped by ASCollectionView.mm to add an `interactionDelegate` as well as calling `enterHierarchyState` on the node and setting its transform to a reflection if `inverted` is set on the collectionView.
This PR adds this behavior to supplementary nodes as well.
* Simplify code / block will never be nil
* Introduce ASCellLayoutMode
* Some smaller improvements
* Improve logic around _superPerformBatchUpdates:completion:
* Add comment about default values for ASCellLayoutModeNone
* Always call _superReloadData:completion: within UICollectionView
* Add initial range test for ASCellLayoutModeNone
* Fix A11Y for horizontal collection nodes in Texture.
Collections have their own handling in UIKit that we shouldn't mess with. As such no nodes that contain CollectionNodes should ever be treated as AccessibilityContainers.
* Update braces
This is a follow up on #1136. Our experiment results show that clearing data frequently is the cause of our #1 crash. @maicki and I believe that this is because if the collection view is being used, silently clearing its data without notifying the backing UICollectionView can put it out-of-sync and causes mayhem next time the collection view processes a batch update. If you look at the stack trace closely, you'll notice that the crash doesn't occur on the same run loop that clearData is called. This made it extremely tricky to investigate and identify the root cause.
Another interesting question would be whether or not we want to clear the data during deallocation at all, since the data will be cleared out soon anyway.
* fix SIMULATE_WEB_RESPONSE not imported #449
* Fix to make rangeMode update in right time
* remove uncessary assert
* Fix collection cell editing bug for iOS 9 & 10
* Rename to reordering.
* Adjust _reordering more acuratedly
* Add change log
* [License] Simplify the Texture license to be pure Apache 2 (removing ASDK-Licenses)
With permission of the Facebook Open Source team, we are simplifying the Texture
license so that clients can rely on the Apache 2 terms that most of Texture is
already covered by. This means that code originally forked from AsyncDisplayKit
will be re-licensed from "BSD 3-clause + PATENTS v2" to Apache 2 without a
PATENTS file.
After getting confirmation that the updates to these core files look good, we'll
propagate this new license header to all files (in this same PR) and get sign-off
from all parties before landing.
* [License] Update all Texture source files to be pure Apache 2.
* Changelog entry for Apache 2 license update.
* Revert "[License] Update all Texture source files to be pure Apache 2."
This reverts commit ffa0fbbba9717d871dd16c4b07539f2f8208fc2b.
* [License] Update all Texture source files to be pure Apache 2, maintaining copyrights.
* [License] Update CONTRIBUTING, README, Podspec & Dangerfile.
* fix SIMULATE_WEB_RESPONSE not imported #449
* Fix to make rangeMode update in right time
* Match interface update closer to UIKit.
* allow the correct exiting sequence for thrashing
* refactor
* - [ASWrapperCellNode] Introduce a new class allowing more control of UIKit passthrough cells.
A few minor fixes to Collections behavior as well, including a new isSynchronized
API. The difference from processingUpdates is that after Synchronized, all animations
have also completed (or runloop turn if animations disabled, so .collectionViewLayout
can be relied on being fully in sync).
More upstreaming to come after this can land...
* Fix -[ASDataController clearData] to take no action before initial data loading.
* Empty commit to kick CI
* Spacing change to kick CI (since an empty commit doesn't work...)
* Tweak ASDataController changes to handle an edge case in _editingTransactionQueueCount management.
* Avoid excess cyclic calls to onDidFinishProcessingUpdates: by avoiding ASMainSerialQueue.
* Reverting my initial change as it wasn't the right approach, following the real fix before this.
* [tvOS] Fixes errors when building against tvOS SDK
* Update CHANGELOG.md
* [tvOS] Fixes implicit conversion between UIViewAnimationCurve +
UIViewAnimationOptions
* Enable tvOS deployment target in Texture.podspec (for CI)
* [ASMultiplexImageNode] Fixes typo
* [tvOS] Fixes warnings related to @available guards in Xcode 9
[ASMultiplexImageNode] Enables support for Photos framework on tvOS 10+
[ASMultiplexImageNode] Fixes comment depth
[ASAvailability] Adjust logic in AS_AVAILABLE_IOS_TVOS to account for
both versions
Adjusts API_AVAILABLE to minimum deployment target
* [ASAvailability] Update AS_AVAILABLE_XXX fallbacks to function more like
the built-in solution (more accurately target OS by checking target)
Change AS_AVAILABLE_IOS -> AS_AVAILABLE_IOS_TVOS in places that shoud
allow for both
[ASAvailability] Simplify AS_AVAILABLE_IOS_TVOS
* [ASControlNode] Adds missing 'super' call in -[ASControlNode didLoad]
when targeting tvOS
* Fix API_AVAILABLE iOS requirement
* [ASDisplayNode] Fixes last of the linker warnings related to category
overrides. Removes methods already implemented in
ASDisplayNode+UIViewBridge category.
[ASControlNode] Moves tvOS category declaration to ASControlNode header
[ASImageNode] Moves tvOS category declaration to ASImageNode header
[ASControlNode+Private] Adds private category for ASControlNode to
access private selectors
* [NSParagraphStyle+ASText] Fixes typo related to testing
* [ASControlNode] Re-add helpful comment
* [ASTextKitCoreTextAdditions] Adds mappings for kCTParagraphStyleSpecifierMinimumLineSpacing, kCTParagraphStyleSpecifierMaximumLineSpacing, kCTParagraphStyleSpecifierLineSpacingAdjustment when mapping CTParagraphStyle onto NSParagraphStyle
[ASTextNode] Uses CoreText-cleansed attributed string when assigning ascender/descender to avoid crash when a CTParagraphStyle is passed as an attribute
* [AsyncDisplayKit] Update project file to include new/deleted files
* [ASControlNode+tvOS] Add missing Foundation import (whoops!)
[ASImageNode+tvOS] Add missing Foundation import (whoops!)
* Update podspec to only link AssetsLibrary framework on iOS
* [ASTextKitCoreTextAdditions] If kCTParagraphStyleAttributeName key-value
evaluates to an NSParagraphStyle, pass through to cleansed attributes. This
fixes a bug that would occur if a CTParagraphStyle was passed as an
attribute _alone_ (would not be caught by unsupported attributes
check)
* [ASMultiplexImageNode] Bump availability check to support < Xcode 9
* [ASTraitCollection] Fixes typo that was causing build to fail
* Clean up formatting to adhere to character/line limit + braces
* Faster collection operations
* Fix a few things
* Put the stupid semicolon
* Address warning
* Cut down retain/releases during collection operations
* Update CHANGELOG.md
* Add support for interactive moves
* Enable drag & drop in collection view example
* Update changelog
* Change the gating logic to match UIKit
* Add a warning when we prevent interactive movement due to async layout
* Make our async deallocation functions take a double pointer, so we can be sure we've released before the queue drains
* Make it a class property
* Fix the return type
* Use a locker
* Improve release notes
* [ASCollectionView] Ensure -invalidateFlowLayoutDelegateMetrics is called for UIKit passthrough cells.
This allows rotation to work properly when rotating UIKit passthrough
cells that need to change width.
* [ASCollectionView] No need to verify node is still in model to handle view-only notifications.
* [ASCollectionView] Improve performance and behavior of rotation / bounds changes.
See #430 for details.
* Edit CHANGELOG.md
* [ASDataController] Implement -relayoutAllNodesWithInvalidationBlock:, to flush the ASMainSerialQueue before -invalidateLayout is called.
* Don't set download results if no longer in preload range. (#606)
Good catch by @djblake, if you scroll fast enough, you leave images
set on the image node because didExitPreloadRange (which would have
cleared it) was already called.
* Animated WebP support (#605)
* Updating to support animated WebP
* Fix a deadlock with display link
* Fix playhead issue.
* Fix up timing on iOS 10 and above
* Don't redraw the same frame over and over
* Clear out layer contents if we're an animated GIF on exit range
* Clear out cover image on exit of visible range
* Don't set cover image if we're no longer in display range.
* Don't clear out image if we're not an animated image
* Only set image if we're not already animating
* Get rid of changes to podfile
* Add CHANGELOG entry
* Update license
* Update PINRemoteImage
* Remove commented out lines in example
* [ASDataController] Add nullable specifier to invalidationBlock for relayout of nodes.
* [ASCollectionView] Fix index space translation of Flow Layout Delegate methods.
This includes a few other cleanups, including overflow of signed integer indices.
* [ASCollectionView] Improve code sharing of UIKit size method calls; ensure delegate invalidation re-fetches supplementary sizes too.
* [ASCollectionView] Final method ordering and doc-comment for new _sizeForUIKitCellWithKind:atIndexPath: method.
* [ASCollectionNode] Add -isProcessingUpdates and -onDidFinishProcessingUpdates: APIs.
Over time, there have actually been a lot of legitimate uses for an API like this.
In fact, I'm not quite sure what has held us back from adding one!
I believe that at least some portion of -wait calls (even if less than 50%) could be
replaced with -onDidFinishProcessingUpdates:, which could potentially improve the
performance of applications using -wait by a significant amount.
Please take a close look at implementation correctness. Although I'm in a bit of a
rush, I'm aiming to make this properly documented and added a basic test -- but it
could certainly use some more detailed testing as a followup.
* [ASCollectionNode] Improvements to the implementation of -isProcessingUpdates and -onDidFinishProcessingUpdates:
* Add lock to ASMainSerialQueue count method.
* [ASTableNode] Implement -isProcessingUpdates and -onDidFinishProcessingUpdates:. Rename -waitUntil to consistent naming.
* Table and collection views to consider their content inset when calculating element size range
* Update CHANGELOG
* Address comments
* -[ASPagerNode currentPageIndex] to use pageSize instead of bounds
* Update documentation in ASPagerNode
* Minor change
* Merge willUpdateWithChangeSet and didUpdateWithChangeSet delegate methods into one
- After #420, there is no change occurs between those 2 methods. Having them separately doesn't achieve anything and can cause confusions.
* Minor change
* [ASCollectionView] Add delegate bridging and index space translation for missing UICollectionViewLayout properties
This is a first attempt at resolving #438.
I know there is already one similar method to do indexPath conversions, and that the #define for
accessing properties on the UICollectionViewFlowLayout should probably be moved somewhere else.
Looking for feedback on the general direction here. In particular, I'm a bit surprised that so much
has changed in how these calls occur, as I believe especially constrainedSizeForNodeAtIndexPath: is
now called with inconsistent index path spaces (but was not before this PR landed in March:
https://github.com/facebookarchive/AsyncDisplayKit/pull/3136/files)
Since the impact of mixing the spaces is fairly serious (can cause crashes), I'm also wondering if
I am misinterpreting some aspects of the code, or if maybe the crashing impact wasn't noticed yet.
* [ASCollectionView] Cleanup and final changes for UIKit passthrough fixes.
* Minor refactors in ASCollectionView and its private cell classes
- `_ASCollectionReusableView` and `_ASCollectionViewCell` no longer expose getters for their collection element and cell node properties. This is to make sure that clients can only obtain elements from the visible map which is always the source of truth.
- Since the map can return `nil` for an element request, it's much safer to check and avoid adding/removing a nil pointer to an `NSArray`.
- Since we use a special way to check whether an object of kind of `_ASCollectionViewCell` or `_ASCollectionReusableView`, based on the assumption that these classes are subclass restricted, I added cast-or-return macros in the header files, closer to where the restrictions are declared.
* Add ASDynamicCastStrict
* Add element and node properties back to _ASCollectionReusableView and _ASCollectionViewCell
* Assert unexpected nil elements
* Always mark an element visible even if it is backed by an UIKit / non-_ASCollection* view
* Fix typo
* Remove unnecessary changes
* Dump mistakes
* Update CHANGELOG
* Can't track visibility of elements backed by non-_AS views