1813 Commits

Author SHA1 Message Date
Michael Schneider
41362fca39 Move call of range update completion blocks to consider early returns in _updateVisibleNodeIndexPaths 2016-03-22 12:43:09 -07:00
Michael Schneider
3668f45286 Prevent deallocation of asyncDataSource and asyncDelegate in ASCollectionView and ASTableView
Grab a strong reference for asyncDataSource and asyncDelegate in ASCollectionView and ASTableView before executing the range update to be sure they are not going away while executing the range update. This can happen in range updates while going back in the view controller hierarchy
2016-03-22 08:09:59 -07:00
appleguy
fbe87cde4b Merge pull request #1410 from maicki/ASRunLoopQueueImproveProcessTriggering
[ASRunLoopQueue] Always signal runloop source if queue is not fully drained, to ensure more batches are guaranteed to run.
2016-03-21 17:12:39 -07:00
Michael Schneider
a937184a0b Remove CFRunLoopWakeUp in CFRunLoop observer callback
We don't nee CFRunLoopWakeUp as at this time are currently running in an observer callback, and after running all of the BeforeWaiting observers it must surely check for more sources / etc to run before determining if it will sleep
2016-03-21 17:10:29 -07:00
Michael Schneider
b3e98e9f5f If the queue is not fully drained yet force another run loop to process next batch of items 2016-03-21 16:58:39 -07:00
Eric Jensen
12da9ac6a9 Improve Swift compatibility of ASHorizontalAlignment & ASVerticalAlignment by using consistent naming 2016-03-21 11:16:28 -07:00
Eric Jensen
b733936133 Improve Swift compatibility of ASCellNodeVisibilityEvent by using NS_ENUM macro 2016-03-21 11:10:28 -07:00
Huy Nguyen
9e76d7b603 Add method to cancel layout transitions in progress
- Also make sure a transition isn't invalidated right after it passed the validation test and before it proceeds
2016-03-20 23:17:35 -07:00
Rahul Malik
4eb3356615 Basic a11y support for ASButtonNode 2016-03-20 19:22:53 -07:00
Sam Stow
086bd8a52b [ASRelativeLayoutSpec] New core layout spec type: Relative Position, now powers Center as well.
This spec allows positioning a child at any 9-part box position (corners, edges, or center).
2016-03-19 22:37:02 -07:00
appleguy
4297cb1eb5 Merge pull request #1398 from facebook/Placeholders
[ASDisplayNode] Placeholders should always be recreated if returning to cleared nodes, and remain until ASNetwork/MultiplexImageNode finish loading their image from the network.
2016-03-19 21:19:05 -07:00
appleguy
36437f2fb7 Merge pull request #1399 from facebook/MKCancel
[ASMapNode] Reduce number of MapKit calls to -cancel by using the .isLoading property.
2016-03-19 21:16:30 -07:00
Scott Goodson
8308a4ce49 [AsyncDisplayKit] Adopt #pragma once, remove last remaining dispatch_sync (UIScreen scale). 2016-03-19 19:56:41 -07:00
Hannah Troisi
f9a92366d3 [AsyncDisplayKit] Fix build so we can weak link AVFoundation
Unclear why the framework target required these seemingly unrelated changes to Collection
classes, but I modeled them after related files and it seems cleaner now (passes tests & framework target)
2016-03-19 17:54:02 -07:00
Hannah Troisi
b98920c19f [ASVideoNode] Add to ASDK umbrella header 2016-03-19 17:10:47 -07:00
Scott Goodson
7bb48d266c [ASMapNode] Reduce number of MapKit calls to -cancel by using the .isLoading property. 2016-03-18 23:31:33 -07:00
Scott Goodson
c5c7abb1d6 [ASDisplayNode] Placeholders should always be recreated if returning to past nodes.
If previously-displayed contents is gone (e.g. clearContents), and is not finished displaying
by the time the node is onscreen, recreate the placeholder immediately.
2016-03-18 21:13:26 -07:00
Michael Schneider
14b9df30a3 Create CFRunLoopSourceContext via calloc 2016-03-18 14:32:45 -07:00
Michael Schneider
d1756baae7 Add custom run loop source to signal if new jobs are enqueued in ASRunLoopQueue
It is not guaranteed that the runloop will turn if it has no scheduled work, and this causes processing of the queue to stop. Attaching a custom loop source to the run loop and signal it if new work needs to be done
2016-03-18 14:02:27 -07:00
Eric Jensen
6739a3a4ab Condition logic simplification 2016-03-17 11:22:53 -07:00
Eric Jensen
17aebcbaba Add a space between the ? and : in ternarys 2016-03-17 10:38:51 -07:00
Eric Jensen
14a389c5e0 Replace ASTextKitAttributes' objectsEqual with the shared ASObjectIsEqual 2016-03-17 10:36:35 -07:00
appleguy
d9ef0922d8 Merge pull request #1354 from ejensen/cleanup
[Refactoring] Objective-C 2.0 / Modern syntax for arrays, dictionaries, numbers; logic simplification
2016-03-17 01:06:33 -07:00
appleguy
2ad9d83520 Merge pull request #1353 from ejensen/spelling
[Documentation] Correct spelling errors
2016-03-16 22:53:15 -07:00
Scott Goodson
a966b7b6a6 [ASImageNode] -setDefaultImage: should release lock before calling -setImage:
This allows -setImage: to fully unlock before it calls -invalidateCalculatedSize.
2016-03-16 20:55:08 -07:00
Michael Schneider
e297608e2a In the first range update and the range mode is not explicitly use the automatic range mode detection
This is necessary to get out of the initial range mode state into the first defined range mode state
2016-03-16 16:44:58 -07:00
Michael Schneider
e82118e72f Add assertion for ASDisplayNode is layer backed if using ASInterfaceStateForDisplayNode 2016-03-16 16:27:08 -07:00
Michael Schneider
41ca796ef4 Improve logic around choosing the range mode automatically and update documentation around logic 2016-03-16 13:37:33 -07:00
Michael Schneider
8d771f930a Refactor calculation of interface state based on ASDisplayNode and window 2016-03-16 13:26:17 -07:00
Michael Schneider
3b4e8d732c Improve way to detect interface state of ASCollectionView and ASTableView 2016-03-16 11:45:22 -07:00
Michael Schneider
19232ac493 Address pull request comments 2016-03-16 11:44:56 -07:00
Michael Schneider
d3ba80ccfd Improvements for automatic range mode
- Only update range mode if visibility changes if the node is not range controlled
- Only change explicitly set range mode if ASRangeController becomes visible
- Return interface state for range controller in ASCollectionView and ASTableView based on if the containing node is range managed
2016-03-16 11:44:56 -07:00
appleguy
b30fa8b2f6 Merge pull request #1373 from maicki/FullRangeModeOnScroll
[ASRangeController] Go into full range mode if a scroll happens
2016-03-16 11:33:43 -07:00
appleguy
85cba28744 Merge pull request #1378 from hannahmbanana/arrayUtils
[ASMultidimensionalArrayUtils] Optimization for recursive version, expanded use case of more efficient 2D version
2016-03-16 11:25:49 -07:00
appleguy
9b26d94da7 Merge pull request #1386 from maicki/ReplaceRecursiveCallsWithHelperFunction
[ASDisplayNode] Replace recursive methods with ASDisplayNodePerformBlockOnEveryNode
2016-03-16 11:20:17 -07:00
Eric Jensen
33fda7ab49 - Use modern Objective-C syntax.
-  Simplify comparisons.
-  Remove dead stores.
2016-03-15 22:34:29 -07:00
Eric Jensen
ddd5ff1f75 Correct spelling errors 2016-03-15 21:56:51 -07:00
appleguy
192e9398e5 Merge pull request #1381 from ejensen/image_modification_block_nullability
[ASImageNode] Annotate imageModificationBlock as nullable
2016-03-15 17:49:34 -07:00
appleguy
1e993c1516 Merge pull request #1377 from erichoracek/fix-umbrella
[AsyncDisplayKit] Ensure overall .h (umbrella header) includes new ASRunLoopQueue.h
2016-03-15 17:31:44 -07:00
appleguy
8fb18714ac Merge pull request #1385 from maicki/DisplayNodePendingNodePropertyDeadlock
[ASDisplayNode] Remove unnecessary lock for subnode display notifications (main thread only), avoid potential deadlock by traversing up hierarchy.
2016-03-15 17:15:13 -07:00
Michael Schneider
f385fa8ada Replace recursive methods with ASDisplayNodePerformBlockOnEveryNode function 2016-03-15 16:34:40 -07:00
Michael Schneider
b7a92b2947 Add documentation for visibilityDidChange: 2016-03-15 16:30:49 -07:00
Michael Schneider
863b0ca956 Remove the lock for accessing _pendingDisplayNodes and force methods regarding display to the main thread
This should fix a deadlock in ASDisplayNode and it's caused by displayWillStart: and where one thread is recursing down the tree and another thread is recursing up the tree. We remove the lock in _pendingDisplayNodes for the property, but need to guarantee that we only modify the _pendingDisplayNodes state on the main thread.

Furthermore add documentation on what thread displayWillStart and displayDidFinish will be called
2016-03-15 16:30:08 -07:00
Huy Nguyen
22b105bfdc ASCollectionView doesn't animate size changes if some of the updated cell nodes don't want to 2016-03-15 16:17:43 -07:00
Eric Jensen
6ebb376a4d Annotate ASImageNode's imageModificationBlock as nullable 2016-03-15 12:58:23 -07:00
Hannah Troisi
7f6ce4e9de [ASMultidimensionalArrayUtils]
- optimized ASRecursivelyFindIndexPathsForMultidimensionalArray() to remove enumerateUsingBlock:
- replaced single project call to ASIndexPathsForMultidimensionalArray() in ASRangeController with ASIndexPathsForTwoDimensionalArray()
2016-03-14 22:47:43 -07:00
Eric Horacek
f39eacf789 Fix umbrella header
`ASRunLoopQueue` was added in #1341 and declared as a public header. However, it was not added to the umbrella header. As-is, when consumers integrate `1.9.7`, the framework will not compile with the error:

```
Umbrella header for module 'AsyncDisplayKit' does not include header 'ASDisplayNode+Beta.h'
```
2016-03-14 11:27:20 -07:00
Gareth Reese
a95300e145 Merged master into AVPlayerItem-construction 2016-03-14 13:21:42 +00:00
Michael Schneider
13aa891ecf Improve way to go into full mode on scroll 2016-03-12 17:45:09 -08:00
Scott Goodson
f97a509541 [ASRangeController] Ensure that even if the collection view layout is inconsistent, it is impossible for a visible item to not be in the display range. 2016-03-12 16:26:33 -08:00