Commit Graph

4523 Commits

Author SHA1 Message Date
Adlai Holler
8b431733d3 Avoid triggering main thread assertions in collection/table dealloc #trivial (#803)
* Avoid triggering main thread assertions in ASCollectionNode/ASTableNode dealloc

* Put it back
2018-02-13 12:02:30 -08:00
Huy Nguyen
e2478fc799 [ASDisplayNode layout] Fix an issue that sometimes causes a node's pending layout to not be applied (#792)
* [ASDisplayNode layout] Fix an issue that causes a node's pending layout to not be applied

- Since the implementation of layout version (#428), if a node's pending and calculated layouts have the same current version as well as the same constrained size, the 2 layouts are considered equal and can be used interchangeably. A layout version check between the 2 layouts was added in #695. This PR adds a missing constrained size check.
- If the pending layout has the same version but a different constrained size compare to the calculated layout's, we can assume that the pending layout is newer and should be preferred over the calculated one. That is because layout operations always register their new layout as pending, which then (immediately or eventually) get applied to the node as calculated layout.
2018-02-12 21:04:58 +00:00
Kevin Bui
f0f3f9acfe Add missing scrollViewWillEndDragging passthrough delegate (#796)
* Add scrollViewWillEndDragging delegate

* Make sure delegate can respond to scrollViewWillEndDragging

* Add changes to CHANGELOG.md
2018-02-12 11:38:20 -08:00
Max Wang
479d40464e [ASTableNode & ASCollectionNode] Keepalive reference for node if their view is necessarily alive (has a superview). (#793)
* fix SIMULATE_WEB_RESPONSE not imported #449

* Fix to make rangeMode update in right time

* Keep collection/table node alive if view still in use.
2018-02-09 12:16:18 -08:00
appleguy
31227da577 [ASRangeController] Fix stability of "minimum" rangeMode if the app has more than one layout before scrolling. (#790)
This should result in memory savings in many apps, since errant relayouts are pretty common.
2018-02-09 11:04:00 -08:00
Huy Nguyen
b4a269aabf [ASDisplayNode] Always return the thread-safe cornerRadius property, even in slow CALayer rounding mode (#749)
- Failing to do so will introduce race conditions in which the property was updated on a background thread but main thread has not executed the block that updates the property of the node's layer. During that window, the layer's property is out-of-date and can't be used.
- After this change, ASDisplayNode's cornerRadius is the only source of truth and users must always use it instead of CALayer's.
2018-02-08 17:08:04 +00:00
Michael Schneider
3ee52e5f3b Add #794 to changelog 2018-02-08 08:34:12 -08:00
Michael Schneider
600b6cb76d Fix ASTextNode2 is accessing backgroundColor off main while sizing / layout is happening (#794) 2018-02-08 08:28:14 -08:00
Michael Schneider
5ea4d51596 Get CatDealsCollectionView example running again #trivial (#783)
* Get CatDealsCollectionView example running again

* Fix it for real and some other styling stuff

* Fix some warning

* Adjust headers
2018-02-02 11:41:19 -08:00
Adlai Holler
c6454214ac Retain the reference color space (#784) 2018-02-02 10:36:17 -08:00
Michael Schneider
38b76e0eb2 Improve nullable annotations for _ASDisplayLayer and _ASDisplayView (#780) 2018-02-01 08:44:47 -08:00
Adlai Holler
1be4d8d088 Add #764 to the changelog 2018-02-01 06:45:07 -08:00
Vladyslav Chapaev
0f061b401e node tint color fix (#764) 2018-02-01 06:43:46 -08:00
Adlai Holler
0c4ccc5253 Improve ASNetworkImageNode delegate callout behavior (#778)
* Improve ASNetworkImageNode delegate callout behavior

* no message
2018-01-31 12:18:04 -08:00
Alex Hill
0bb53552b0 [ASCellNode] focusStyle mapping (#727)
* [ASCellNode] Adds mapping for UITableViewCell focusStyle

* Update CHANGELOG.md
2018-01-31 10:07:08 -08:00
Huy Nguyen
ea547270f2 [ASDisplayNode] Force a layout pass on a visible node as soon as it enters preload state (#779)
This reverts commit 2e98588372 (#751).

The reason we can't wait for the coming CA's layout pass is that cell node visibility events occur before the pass, at which time the cell's subnodes don't have correct frames for impression tracking.

The root cause of this problem is that, right now, cell node visible states are set by ASRangeController well before the layout pass of the hosting collection/table view. That means we're "jumping the gun". The more I think about this, the more I agree with @Adlai-Holler that we need to treat visible state differently. That is, a node should only be visible (and thus get visibility events) after it's fully loaded, it's view/layer attached to the hierarchy and laid out by a CA transaction. In other words, at the end of the CA layout pass. Such change needs time and effort to be thoroughly reviewed and tested. Until then, let's roll with this fix.
2018-01-31 15:35:14 +00:00
Aaron Rosenberger
d6971980a3 Fixed: completeBatchFetching is called on a background thread (#731)
* Fixed breaking issue where completeBatchFetching is called on a background thread when no items are added to the collection

* Changed spaces to tabs for consistency

* Moved return statement for Code Review feedback

* Fixed the same issue in the Objective-C version of ASDKgram

* One more

* Update PhotoFeedModel.m

Fix header
2018-01-31 10:23:04 -05:00
Denis Morozov
511bec63a2 Fix capturing self in the block while loading image in ASNetworkImageNode (#777)
* Fix capturing self in the block while loading image in ASNetworkImageNode

* Restore re-strongify while switching on the main thread

* Update CHANGELOG.md
2018-01-31 10:20:00 -05:00
Michael Schneider
20e31f7d70 Fix synchronous state of node if +viewClass or +layerClass is overwritten #trivial (#776)
* Fix synchronous state of node if +viewClass is overwritten

* Also check for _layerClass overwrite for synchronous flag

* Update some code style
2018-01-31 07:07:38 -08:00
Adlai Holler
fef965f78e Add support for providing additional info to network image node delegate (#775)
* Add support for piping arbitrary user info from ASImageDownloader to the ASNetworkImageNodeDelegate

* s/source/sourceType

* Fix stuff and take Michael's advice
2018-01-30 17:50:38 -05:00
Michael Schneider
196d76d82d Expose asyncdisplaykit_node in _ASDisplayView same as in _ASDisplayLayer #trivial (#773)
* Expose asyncdisplaykit_node in _ASDisplayView same as in _ASDisplayLayer

* Change comment
2018-01-30 14:24:46 -08:00
Justin Swart
7ba4376b6f Update PINCache (#769) 2018-01-30 14:19:37 -05:00
Adlai Holler
2e94bb8120 Improve no-copy rendering experiment, remove +load method (#771)
* Improve graphics contexts experiment

* Update changelog

* Remove extra space

* Add a unit test for screen scale

* Fix typo and use unique value
2018-01-30 14:18:37 -05:00
Flatout73
b0c3e65da8 Fix misprint (#768) 2018-01-29 12:05:48 +00:00
Denis Morozov
3f27546ec8 Fix typos in layout2-layoutspec-types.md #trivial (#770) 2018-01-29 12:05:33 +00:00
Adlai Holler
c3ae4474d0 NoCopyRendering experiment: Fix possible memory leak if image node rendering is canceled #trivial (#765)
* Fix memory leak if image node rendering is canceled

* Update comment
2018-01-23 10:45:34 -08:00
Adlai Holler
9b8a919a93 Revert "Faster collection operations (#748)" (#759)
This reverts commit 5c13403ef7.
2018-01-22 11:38:09 -08:00
Adlai Holler
5c13403ef7 Faster collection operations (#748)
* Faster collection operations

* Fix a few things

* Put the stupid semicolon

* Address warning

* Cut down retain/releases during collection operations

* Update CHANGELOG.md
2018-01-22 13:22:03 +00:00
janechoi6
b5d3e52e8b Update subclassing.md (#753) 2018-01-18 16:00:15 +00:00
Huy Nguyen
2e98588372 [ASDisplayNode] Don't force a layout pass on a visible node that enters preload state (#751)
- After #706, a layout pass is forced on an ASM-enabled node that enters preload state to make sure that its subnodes can start preloading as well. However, when the node is visible, a (coalesced, thus more efficient) layout pass will be triggered by CA soon anyways, so rely on it instead.
2018-01-17 15:35:02 +00:00
Adlai Holler
4776cb3dcd Fix the dangerfile for real (#750) 2018-01-16 20:55:27 +00:00
Yevgen Pogribnyi
a3136b0225 [ASTraitCollection] Add missing properties to ASTraitCollection (#625)
* [ASTraitCollection] Add missing properties to ASTraitCollection

* ASTraitCollection now completely reflects UITraitCollection

* Add ASContentSizeCategory enum that corresponds to
  UIContentSizeCategory and can be used inside a struct.

* * Remove enum ASContentSizeCategory.
* Use __unsafe_unretained UIContentSizeCategory instead of the enum.

* Added ASPrimitiveTraitCollection lifetime test

* Changes requested at code review:
* Restore one of the ASTraitCollection constructors with a deprecation notice.
* Clean up API by the separation of tvOS-specific interfaces.
* Use [NSString -isEqualToString:] for ASPrimitiveContentSizeCategory equality tests for better readability.
* Encapsulate fallback logic for UIContentSizeCategoryUnspecified.

* Fix failing test
2018-01-16 18:08:29 +00:00
Adlai Holler
193be32bcf Update dangerfile for 2018 #trivial (#746)
* Update the dangerfile

* Make a trivial change to test new dangerfile

* Try out the new value with another trivial change
2018-01-15 15:13:54 -08:00
Adlai Holler
61dade6bda Raise deployment target to iOS 9 (#743)
https://github.com/TextureGroup/Texture/pull/743

Manually merged since I forgot to retarget that diff onto master before merge
2018-01-15 15:13:05 -08:00
Adlai Holler
1d105c2056 Add an experimental "no-copy" renderer (#741)
* 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
2018-01-13 19:19:08 -08:00
Garrett Moon
3708f2e448 Update CHANGELOG for 2.6 2018-01-12 13:01:28 -08:00
Sudhanshu
1dfdb48497 Add MensXP to Showcase (#739)
This change is for adding "MensXP: Fashion, Grooming tips" iOS App to Texture showcase.
2018-01-10 10:15:53 -08:00
Adlai Holler
5e73396cde Enable collection node interactive moves (#735)
* 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
2018-01-09 14:34:32 -08:00
appleguy
131619de96 Reimplement ASRectTable using unordered_map to avoid obscure NSMapTable exception. (#719)
* Reimplement ASRectTable using unordered_map to avoid obscure NSMapTable exception.

The new class is called ASRectMap, which patterns alongside ASIntegerMap in both name and implementation.

After some pretty detailed investigation, including study of open-source reimplementations
of Foundation, the best lead I've found on the NSMapTable exception is that
some NSPointerFunction types are not fully supported. Strangely, the ones being used
do seem to work fine almost all of the time.

The main concern is the Struct memory type, which is not officially re-declared in
NSMapTable, and as such the documentation claims that there may exist some
combinations of NSPointerFunction that are not supported.

Because the exception is occurring frequently enough to be a concern (in the hundreds
to low thousands, though only 50 a day) - I decided to replace NSMapTable entirely
in order to ensure full correctness.

"*** -[NSMapTable initWithKeyPointerFunctions:valuePointerFunctions:capacity:] Requested configuration not supported."

* Fix Xcode project
2017-12-21 16:17:25 -08:00
Stephen Williams
4dec51ca37 Fix ASDKgram example #trivial (#700)
- Fix an insta-crash that's caused by Webservice.load method to call its completion block off the main thread.
- Fix incorrect http status code check.
- Bump the deployment target to get the project compiling.
2017-12-20 12:53:13 +00:00
John T McIntosh
fff5aae0a5 Add support for toggling logs off and back on at runtime #trivial (#714) 2017-12-20 12:49:09 +00:00
Huy Nguyen
7416d6a88a Add Blendle to our showcase page (#721) 2017-12-19 18:53:13 +01:00
Ilya
eab7bea48d Add missing flags for ASCollectionDelegate (#718)
* Add missing flags for ASCollectionDelegate

* Update CHANGELOG.md
2017-12-19 17:13:45 +00:00
César Estébanez Tascón
8f19434788 Check for nil elements on ASTableView as well #trivial (#710) 2017-12-19 16:56:35 +00:00
Garrett Moon
46d46fdf12 #trivial Fixes image nodes being stuck not being able to download image (#720)
* #trivial Fixes image nodes being stuck not being able to download image

* Clear out the _cacheUUID too even though this is not strictly necessary.
2017-12-18 15:15:29 -08:00
Ha Hyun soo
8300d8eb61 Vingle very community - Update showcase (#711) 2017-12-11 19:47:41 -08:00
Huy Nguyen
5a4d569c56 Ensure an ASM enabled node applies its pending layout when enters preload state (#706)
This makes sure subnodes are inserted and start preloading right away, instead of waiting until the next layout pass of the supernode. Fixes #693.
2017-12-08 18:30:26 +00:00
Garrett Moon
008a1ce208 Revert Adds support for specifying a quality indexed array of URLs (#699)
* Revert "Adds support for specifying a quality indexed array of URLs (#557)"

This reverts commit 3c77d4a5da.

* Add CHANGELOG entry
2017-12-05 13:55:19 -08:00
Garrett Moon
0b6d41f872 A couple performance tweaks for animated images #trivial (#634)
* A couple performance tweaks for animated images

* @nguyenhuy's comments

* Avoid calling animatedImageData twice. Thanks @maicki.

* Fix call to background deallocation

* Good catch by @Adlai-Holler
2017-12-04 14:56:04 -08:00
Andrew Yates
c1f517a7eb Correct Synchronous Concurrency Talk Link (#698)
Fixes #697.
2017-12-04 10:41:00 -08:00