* Adds support for using UIGraphicsImageRenderer in ASTextNode.
In many cases this reduces the backing store of text nodes by 1/2.
* Guard for UIGraphicsRenderer availability.
* Comma
* Expose textLayoutForConstraint:
- Expose textLayoutForConstraint:, but make unavailable on ASTextNode
- Refactor compatibleLayoutWithContainer:text: into a static method
* Instead of textLayoutForConstraint: expose shouldTruncateForConstrainedSize: in ASTextNode
* [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.
- Rename `ASDisplayNodeAssertLockUnownedByCurrentThread` to `ASAssertUnlocked`, and `ASDisplayNodeAssertLockOwnedByCurrentThread` to `ASAssertLocked` -> shorter and hopefully easier to distinguish between the two.
- Add assertions to `_locked_` and `_u_` (i.e "unlocked") methods.
- Turn `CHECK_LOCKING_SAFETY` flag on by default. After #1022 and #1023, we're in a good shape to actually enforce locked/unlocked requirements of internal methods. Our test suite passed, and we'll test more at Pinterest after the sync this week.
- Fix ASVideoNode to avoid calling `play` while holding the lock. That method inserts a subnode and must be called lock free.
- Simplify `_loaded(node)` to only nil-check `_layer` because regardless of whether the node is view or layer backed, the layer should always be set if loaded. Use it throughout.
- Other minor changes.
Because multiple threads can enter this allocWithZone: method around the same time, it is possible for one of them to setSuperclass first, and then the second thread would get stuck in an infinite loop. When climbing the inheritance heirarchy, ASTextNode2 would be encountered by this second thread, and it would continue until reaching c == Nil. Since there was no case to catch this, an infinite loop would result. Then the main thread can be deadlocked if a method like waitUntilAllUpdatesAreProcessed is called on ASCollectionView.
* Update the dangerfile
* Make a trivial change to test new dangerfile
* Try out the new value with another trivial change
* Add a configuration API to make a unified place for pulling config from clients safely
* Specify properties for delegate
* Finish removing text experiment global enable
* Generate the config file
* Clean up configuration to fix tests
* Work on making it serializable
* Finish it up
* Fix example code
* Update sample project
* Clean up a few things
* Align with new project order
* Make it faster and update license header
* Add an option to specify your config at compile time
* Update another license header
* Add a version field, and bring interface state coalescing into configuration
* Update CA queue code
* Update CATransactionQueue tests
* Turn transaction queue on by default (for now, see comment)
* Update the tests
* Update the tests AGAIN
* Remove unused ordered set
* Make display node, layout spec, and style conform to NSLocking so that users/subclasses can access their locks
* Update the changelog
* Align slashes
* Put it back, when we're in ASDisplayNode
* Go a little further
* Put back the changes I didn't mean to commit
* Kick the CI
* Fix yoga build
* Put back non-locking change
* Address comments from Scott
* [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
* Add "ASGraphicsContext" to skip copying our rendered images
* Zero the buffer before making a context
* Update license header
* Update dangerfile
* Make it a runtime flag
* Restore GState for good measure
* Free buffer if end without image
* Enable the experiment, and cut out the middle-man
* Fix typo
* Fix crashes caused by failing to unlock or destroy a static mutex while the app is being terminated
* Allocate static mutexes on the heap memory to avoid destruction at app exit
* ASThread to use ASDisplayNodeCAssert() instead of assert()
* [ASTextNode2] Provide compiler flag to enable ASTextNode2 for all usages.
The runtime switch is helpful, but is too slow to be shipped in a large
production application where startup time is carefully optimized.
Although this doesn't pass text-related snapshot tests when enabled, it
does allow apps to rely on built-in components like ASButtonNode using
the same text stack as when they are manually creating ASTextNode2
instances.
A simpler approach would be to use a #define ASTextNode ASTextNode2,
but this would create unusual keyword highlighting in code referencing
ASTextNode. However, because it would be less invasive and this is
not on by default, we could do that instead if preferred.
* Update AsyncDisplayKit.h
* [ASTextNode2] Improve naming and documentation of ASTEXTNODE_EXPERIMENT_GLOBAL_ENABLE
* [ASTextNode2] CHANGELOG.md for #410.
* Fix alignment of ASImageNodeContentsKey struct to fix hashing
* Change the change log by logging a change
* Add the world's stupidest explicit cast
* Actually its simpler
* Add experimental text node implementation, based on YYText
* Fix warnings and alert when unimplemented experimental features are used.
* Address feedback from review
* Extend the cthulog
* Update license headers
* [ASTextNode] Reset _composedTruncationText when attributedText is updated
Current issue:
1) Set `attributedText` in `ASTextNode` with whiteColor
2) `_composedTruncationText` gets updated to take on this new color attribute
3) Set the `attributedText` with greenColor
4) The `_composedTruncationText` gets updated with the new attributes, but does NOT overwrite any existing attributes — i.e., does not overwrite the white color with green. Comment from `_locked_prepareTruncationStringForDrawing:`:
`
// Add any of the original string's attributes to the truncation string,
// but don't overwrite any of the truncation string's attributes
`
* michael’s suggestion
* Improve locking situation in ASDisplayNode subclasses
* Adress first number of comments
* Don’t hold the lock while calling _updateComposedTruncationText