472 Commits

Author SHA1 Message Date
Max Wang
affddb0e96 Set default tuning params (#1158)
* 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

* Revert "Fix collection cell editing bug for iOS 9 & 10"

This reverts commit 06e18a10596622ff8a68835c95a23986d7bf61ea.

* Only test when photo library is enabled.

It will fail to build if photo library is disabled cause the test is
depending on it.

* Add ChangeLog.

* set default tuning parameters for collection/table node

* add change log

* Move to framework private.

* Apply to tableNode

* trigger ci

* fix directory

* fix file link
2018-10-10 10:46:33 -07:00
Michael Schneider
a3763c9c91
Fix crash if setting attributed text on multiple threads (#1141) 2018-10-09 07:39:38 -07:00
Eric Jensen
565da7d493 Add missing NS_NOESCAPE in overwritten methods (#1139)
Fixes -Wmissing-noescape warnings
2018-10-04 09:33:08 -07:00
Huy Nguyen
e70325563a
Only clear ASCollectionView's data during deallocation (#1154)
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.
2018-10-03 16:14:01 -07:00
Michael Zuccarino
9588692361 Clean up timing of layout tree flattening/ copying of unflattened tree for Weaver (#1157)
* Simpler Huy fix for more efficient delayed flattening of the layout tree

* Nit

* Remove pbx changes

* Update CHANGELOG.md

* Add note about change in timing of _flattenedLayout capture
2018-10-03 14:49:15 -07:00
ernestmama
5e0579308d Rollout ASDeallocQueueV2 #trivial (#1143) 2018-10-01 11:20:12 -07:00
Huy Nguyen
5dd5611c2c
Add missing comma in ASExperimentalFeatures #trivial (#1137) 2018-09-20 15:46:39 -07:00
Michael Schneider
4708522bd0
Add ASExperimentalSkipClearData #trivial (#1136)
* Add ASExperimentalSkipClearData

* Move the experiment check within the if clause
2018-09-20 09:22:18 -07:00
Eric Jensen
696f344301 Fix compilation warnings #trivial (#1132)
* Apply recommended warnings

* Squelch designated initializer warning in ASViewController

* Remove unused compiler flag

clang: warning: argument unused during compilation: '-fno-objc-arc-exceptions' [-Wunused-command-line-argument]

* Fix warning about overriding an instance variable within a category

Instance method 'methodOverrides' in category from _ASDisplayView.o overrides method from class in ASDisplayNode.o
2018-09-20 07:54:10 -07:00
ernestmama
71ef0fc3ed Fix downloader method name mismatch #trivial (#1134) 2018-09-19 13:07:06 -07:00
Adlai Holler
ceed2d2008 Remove reliance on shared_ptr for ASDisplayNodeLayouts (#1131)
* Remove reliance on shared_ptr for ASDisplayNodeLayouts

* Fix up

* Fix in yoga

* Back to let

* Returns inner pointer

* Trivial change to kick the CI
2018-09-19 11:23:19 -07:00
Michael Schneider
cd608c9b18
Remove necessity to use view to access rangeController in ASTableNode, ASCollectionNode (#1103) 2018-09-19 07:51:46 -07:00
Adlai Holler
69ed9562df
Remove ASRectMap, which is not worth its own weight (#1127) 2018-09-18 11:58:24 -07:00
Adlai Holler
d2984ced8d Make yoga & layout specs faster by eliminating some copies (#1128) 2018-09-18 07:26:29 -07:00
Huy Nguyen
47e2b9c0de
[ASPINRemoteImageDownloader] Fix +setSharedPreconfiguredRemoteImageManager:'s doc #trivial (#1126) 2018-09-18 07:12:01 -07:00
ernestmama
1452b31a24 Add a method for setting preconfigured PINRemoteImageManager to ASPINRemoteImageManager (#1124)
* add a method for setting preconfigured PINRemoteImageManager instead of using the self-created ASPINRemoteImageManager

* update preconfigured image manager where it can only be set once

* fix spacing in downloader

* Fix doc/comments on new api

* adding assertion to ensure either only configuration or preconfigure image manager can be set at a time

* adding assertion to ensure either only configuration or preconfigure image manager can be set at a time

* fix assertion condition

* Update CHANGELOG.md

* Remove unnecessary change
2018-09-17 17:15:43 -07:00
Adlai Holler
9bcafefa33
Remove use of NSHashTable for interface state delegates #trivial (#1122)
* Remove use of NSHashTable for interface state delegates #trivial

* Stray line

* One more case

* Add code to let people have more delegates

* Do it more
2018-09-17 14:29:22 -07:00
Huy Nguyen
f161665f5f
Fix typos and minor code cleanups #trivial (#1120)
- Fix typos in ASEditableTextNode.h and ASDisplayNode+FrameworkPrivate.h.
- Remove unnecessary declaration for ASPINRemoteImageDownloader's sharedDownloader class property.
- Remove unnecessary empty lines in ASPINRemoteImageDownloader.m and ASEditableTextNode.h.
2018-09-17 13:35:00 -07:00
Adlai Holler
fa8da15e69
Don't copy onDidLoadBlocks #trivial (#1123) 2018-09-17 12:40:18 -07:00
Max Wang
bf8d268573 Interface state not update correctly during layer thrash. (#1111)
* 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

* Revert "Fix collection cell editing bug for iOS 9 & 10"

This reverts commit 06e18a10596622ff8a68835c95a23986d7bf61ea.

* Fix interface state not update correctly during layer thrash

* add change log
2018-09-17 10:11:04 -07:00
Max Wang
1f0a213fe9 Fix layer backed nodes not update properly (#1110)
* 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

* Do not cancel on exit, interface state update should handle it.

* Revert "Fix collection cell editing bug for iOS 9 & 10"

This reverts commit 06e18a10596622ff8a68835c95a23986d7bf61ea.

* add space to trigger ci

* add change log
2018-09-14 15:25:27 -07:00
Michael Schneider
f759d5cc7d
Improve locking around clearContents (#1107)
* Improve locking around clearContents

* Add changelog
2018-09-14 08:48:19 -07:00
Adlai Holler
eb5bd0942b
Don't copy container during ASTextNode2 layout (#1115) 2018-09-13 11:06:12 -07:00
Adlai Holler
1d2f1f2ed8
Don't setNeedsDisplay on text node measure #trivial (#1116) 2018-09-13 11:05:48 -07:00
Max Wang
69ab24bc00 Make interface state delegate non optional (#1112)
* 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

* Revert "Fix collection cell editing bug for iOS 9 & 10"

This reverts commit 06e18a10596622ff8a68835c95a23986d7bf61ea.

* Make interface state delegate protocol non-optional.

* add change log

* add missing removal

* add required method to ASNodeController

* fix indentation

* Update CHANGELOG.md
2018-09-12 09:48:39 -07:00
Michael Schneider
a798cf9008
Call out to AnimatedImage subclass hook in the next runloop cycle (#1087) 2018-09-12 09:39:22 -07:00
Adlai Holler
56c94a8941
Add a -textureDidInitialize delegate callback (#1100) 2018-09-06 11:08:45 -07:00
Adlai Holler
395fbd1302 Reuse interface state delegates when calling out #trivial (#1099)
* Reuse interface state delegates when calling out instead of always copying
2018-09-05 22:52:41 -07:00
Adlai Holler
6b0d57eda4 Explicitly cast to (void *) -> (const void **) to satisfy strict compilers (#1098) 2018-09-05 22:49:08 -07:00
Max Wang
dbcf8babb8 Fix collection editing (#1081)
* 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
2018-09-05 08:08:46 -07:00
Max Wang
eba4e290a5 Allow to add interface state delegate in background. (#1090)
* fix SIMULATE_WEB_RESPONSE not imported #449

* Fix to make rangeMode update in right time

* remove uncessary assert

* Allow to add interface state delegate in background threads.

* Allow to add interface state delegate in background threads.

* lock around _interfaceStateDelegates

* lock _interfaceStateDelegates to local variable

* Fix comments

* remove extra spaces
2018-08-31 13:16:55 -07:00
Garrett Moon
1fe241df91 #trivial Shouldn't hold the lock while adding subnodes (#1091)
* Shouldn't hold the lock while adding subnodes

* Add comments, good call @nguyenhuy
2018-08-30 22:04:40 -07:00
Garrett Moon
cae37623fd
Add subnode should not be called with the lock held. (#1088) 2018-08-30 09:30:34 -07:00
appleguy
465abb1ded [License] Simplify the Texture license to be pure Apache 2 (removing ASDK-Licenses). (#1077)
* [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.
2018-08-28 07:39:18 -07:00
Jia Wern Lim
1d31fc21d4 Refactored accessibleElements to accessibilityElements (#1069)
* Refactored `accessibleElements` to `accessibilityElements`, and removed the re-definition of the property.

With this refactor, the field can now be used as a single access point into the accessibility elements of a view. Also, removing the re-definition of the property in _ASDisplayViewAccessibility.h enables us to make use of the field and its associated helper methods directly from the `UIAccessibilityContainer` API rather than rolling our own implementation.

* Added tests for the accessors to ASDisplayView.accessibilityElements.

* Commented out tests for older a11y accessors & added relevant warnings.

Also added assertions that the getter and setter for the accessibilityElements
property are used only on the main thread.
2018-08-24 20:41:27 +02:00
Huy Nguyen
31cb65b38a
Fix compiler error in ASLocking #trivial (#1079) 2018-08-22 16:14:03 -07:00
Eric Jensen
5f912d1cd1 Remove double scaling of lineHeightMultiple & paragraphSpacing attributes in ASTextKitFontSizeAdjuster (#1056) 2018-08-15 11:08:32 -07:00
Adlai Holler
03e6ce0916
Reduce copying in ASTextNode2 stack (#1065)
* Remove copying in text stack, make text container have an optional immutable mode

* Changelog

* Comment

* Update CHANGELOG.md

* Use new name

* Import header
2018-08-07 08:32:43 -07:00
Adlai Holler
2bb216b02e Readability improvements in ASDataController #trivial (#1067) 2018-08-05 17:24:13 -07:00
Michael Schneider
847884a7b4
Add NS_DESIGNATED_INITIALIZER to ASViewController initWithNode: (#1054)
* Add NS_DESIGNATED_INITIALIZER to ASViewController initWithNode:

* Add changelog
2018-08-05 08:20:20 -07:00
Adlai Holler
b136e84b4e
Add an experimental framesetter cache in ASTextNode2 (#1063)
* Add an experimental framesetter cache in ASTextNode2, and stop keeping framesetters around

* Update configuration schema

* Fix imports

* Fix import again and remove set statement
2018-08-04 07:33:53 -07:00
Adlai Holler
c5b1d09b49
Remove direct ivar access on non-self object to fix mocking case #trivial (#1066)
* Remove direct ivar access on non-self object to prevent issues when the object is actually a mock

* Comment

* Remove lock to avoid deadlock risk
2018-08-03 16:35:24 -07:00
Adlai Holler
40e3bf8952
Remove objc association & weak proxy from node -> controller pointer (#1061)
* Remove objc association & weak proxy from node -> controller relationship

* Rename ASNodeController+Beta.m to ASNodeControllerx+Beta.mm

Currently we can't import ASDisplayNodeInternal from C

* Update project pointers

* Rename ASNodeControllerx+Beta.mm to ASNodeController+Beta.mm
2018-08-03 10:24:37 -07:00
Adlai Holler
e76b4f02f6
Remove extra string/attributed string creation in accessibility properties (#1062) 2018-08-03 10:23:05 -07:00
Adlai Holler
093ae3fba0
Remove CATransaction signposts because they cause more transactions than needed and are too chatty. (#1060) 2018-08-02 08:39:01 -07:00
Adlai Holler
78be342e77
[ASTextNode2] Simplify allocWithZone: + initialize implementation #trivial (#1059)
* Simplify ASTextNode2 alloc + initialize implementation

* Kick the CI by marking two methods as NO_ESCAPE for Xcode 10
2018-08-02 07:36:26 -07:00
Michael Schneider
9e2947e7fb
Revert "Optimize drawing code + add examples how to round corners (#996)" (#1055)
This reverts commit eb4c21c54540d2c1c0b63a6b0665a77fea810e6c.
2018-07-31 04:40:18 -07:00
Michael Schneider
eb4c21c545 Optimize drawing code + add examples how to round corners (#996)
* Use CoreGraphics for drawing and cropping of node content

* Smaller fixes
2018-07-26 09:44:10 -07:00
Max Wang
905c582497 Background image load api (#1007)
* fix SIMULATE_WEB_RESPONSE not imported #449

* Fix to make rangeMode update in right time

* remove uncessary assert

* add api to allow delegated calls in background.

* fix typo

* 1. Add class property to decide whether to send delegate callbacks on
main or background.
2. remove non-info api.

* Refactor.

* add ivar for class property.

* Donot use extra api.

* Refactor

* refactor

* revert to use let

* refactor

* make class property atomic.

* kick of new ci test.

* kick off new ci
2018-07-24 15:57:59 -07:00
Huy Nguyen
95de2ab126
Avoid setting frame on the backing store while holding a node's lock (#1048)
Doing so may trigger `-layer:didChangeBoundsWithOldValue:newValue:` on the layer's delegate (i.e `ASCALayerExtendedDelegate`) which then runs other operations that require the lock to be free.
2018-07-24 15:03:47 -07:00