Commit Graph
3600 Commits
Author SHA1 Message Date
Adlai Holler c2ea7cfeac [Umbrella] ASCollectionView -> ASCollectionNode Migration, Separate Index Spaces (#2372)
* Separate dataSource & UIKit index spaces

Beef up our supplementary node support

Make the API way better

Go nuts

Add a unit test for UICollectionView's handling of reloadData inside batch updates

Wrap indexPathForNode: in a cache

Convert index paths in delegate methods

Go back on table view

Put collection view back

Switch up the API

Move most ASCollectionView API to ASCollectionNode

Move most table logic over to ASTableNode

Do the things

More conversion work

Keep on keepin' on

Get table view delegate API done

More porting

Simplify

Clear the delegate

More cleanup

Move more stuff around

Remove pointless file

Re-add some API

Put back more API

Use the right flag

* Some cleanup

* Remove incorrect comment

* Tweak the API

* Put back a couple methods

* update example projects (note: ASCollectionView deprecation warnings expected)

* change reloadDataWithCompletion:nil --> reloadData

* Clean up rebase

* Make deprecated numberOfItemsInSection methods optional

* Use the right flag

* Address nits

* update ASDKTube, ASDKgram & ASViewController examples
2016-10-14 17:21:16 -07:00
Adlai Holler fb768683bc Fix test method name (#2380) 2016-10-14 09:58:32 -07:00
Garrett Moon 1d28639301 [ASCollectionNode] Add scrollableDirections method to ASCollectionViewLayoutInspecting p… (#2381)
* Add scrollableDirections method to ASCollectionViewLayoutInspecting protocol

ASViewController's default method will not always return the correct scrollable
directions in cases where size changes may not have been applied. This allows
us to ignore this issue for a little while longer by allowing the layout
inspector to explicitly vend this.

* Better header, thanks @maicki!
2016-10-14 09:39:28 -07:00
Michael Schneider 3f11c67c82 Return CGSizeZero in case a ASNetworkImageNode is asked for the size and the image did not load yet (#2378) 2016-10-13 14:03:15 -07:00
Adlai Holler cb838664aa [ASTextNode] Go Back to Having Renderer as Ivar (#2376)
* Revert "Disable ASTextKitRenderer cache (#2315)"

This reverts commit 4aa7c9631d.

* Revert "[ASTextNode] Add NSCache based cache for ASTextKitRenderer (#2199)"
2016-10-13 11:37:56 -07:00
Adlai Holler 60b40d8e1c Revert "Scrollable direction is invalid until a relayout. (#2375)" (#2377)
This reverts commit 9abae013a7.
2016-10-13 11:24:57 -07:00
Garrett Moon 9abae013a7 Scrollable direction is invalid until a relayout. (#2375) 2016-10-13 10:51:23 -07:00
appleguy 4595ebc06e [ASLog] Add new ASProfilingSignpost defines for System Trace flags. (#2370)
* [Debugging / Profiling] Add kdebug_signpost calls to Range and DataController.

* [ASLog] Add new ASProfilingSignpost defines for System Trace flags.

* [ASLog] Improve kdebug_signpost logging: ASRunloopQueue and AsyncDisplay, and colors.
See https://github.com/facebook/AsyncDisplayKit/pull/2370 for screenshots.
2016-10-13 10:31:22 -07:00
Garrett Moon 8729bc0502 This is super minor, but active processor account takes into processors that may be out of commission due to boot arguments or thermal conditions. (#2373) 2016-10-12 15:54:59 -07:00
Michael Schneider 8491155fb4 Add locking for ASStackLayoutElement and ASAbsoluteLayoutElement (#2371) 2016-10-12 13:40:53 -07:00
Michael Schneider 8f8df537d2 Rename ASRelativeSize to ASLayoutSize (#2369) 2016-10-11 16:36:40 -07:00
Michael Schneider 507bc55504 [Layout] Add ASLayoutElementStylability protocol (#2366)
* Add ASLayoutElementStylability protocol

* Rename to styledWithBlock:, add instancetype and add noescape
2016-10-11 09:16:18 -07:00
Garrett Moon 4f3593b211 Improving documentation based on feedback. Thanks @appleguy! (#2364)
* Improving documentation based on feedback. Thanks @appleguy!

* :palm + forehead:
2016-10-07 16:59:44 -07:00
Adlai Holler c72b2b212c Tiny change to the doc for ASDimensionMake (#2362) 2016-10-07 10:00:58 -07:00
Hannah Troisi a79e0be016 quick renaming (#2358) 2016-10-07 09:32:38 -07:00
Michael Schneider bb7118a26a Fix ASAbsoluteLayoutSpec creation children protocol (#2357) 2016-10-06 20:37:12 -07:00
Adlai Holler aece8365dd Adjust layoutAttributes logic to account for new iOS 10 behavior (#2354) 2016-10-06 19:42:36 -07:00
Garrett Moon 881863fd1b [Documentation] Improve ASCollectionNode docs. (#2318)
* Improve ASCollectionNode docs.

* Spelling fix, thanks @hannahmbanana

* Address Adlai's comments
2016-10-06 21:20:24 -04:00
Michael Schneider 6f2c7caac3 [Layout] Improve ASDimensionMake via NSString (#2351)
* Improve ASDimensionMake via NSString

- ASXCTAssertEqualDimensions
- Add support for "auto"
- Assert if given an empty or invalid string

* Address comments

* Add ASCGFloatFromString and ASCGFloatFromNumber

* Rename CGRect+ASConvenience to CoreGraphics+ASConvenience
2016-10-06 16:29:33 -07:00
Michael Schneider 166414dfc9 [Layout] Lazy initialize ASLayoutElementStyle in ASDisplayNode and ASLayoutSpec (#2352)
* Lazy initialize `ASLayoutElementStyle` in `ASDisplayNode`

* Lazy initialize `ASLayoutElementStyle` in `ASLayoutSpec`
2016-10-06 16:53:40 -04:00
Michael Schneider 94f958c4a3 [Layout] Treat flex factors as true factors (#2349)
* Treat flex factors as factors

* Add snapshot tests

* Address comments
2016-10-06 16:53:26 -04:00
Adlai Holler 124234fef8 [Umbrella] Add warn_unused_result Attribute to Public Headers (#2353)
* Add some warn_unused_result attributes

* Add more

* Add some more
2016-10-06 16:44:49 -04:00
Michael Schneider 271ab20de5 Fix ASDimension creation of type ASDimensionUnitFraction via a NSString (#2347) 2016-10-05 18:30:24 -07:00
Garrett Moon 27cccc74ae [Documentation] Added docs for ASBasicImageDownloader & ASPINRemoteImageDownloader (#2327)
* Added docs for ASBasicImageDownloader & ASPINRemoteImageDownloader

* Had wrong @return syntax for sharedPINRemoteImageManager
2016-10-05 17:47:45 -07:00
Garrett Moon 874dda00cf [Documentation] Improve ASVisibility protocol documentation (#2319)
* Improve ASNavigationController, ASTabBarController and ASVisibility protocol documentation.

* Spelling and grammar fixes. Thanks @hannahmbanana!
2016-10-05 17:43:59 -07:00
Garrett Moon df049eceef Added docs for initer and node property. (#2326) 2016-10-05 17:35:07 -07:00
Garrett Moon b9e54363ef Documenting ASWeakProxy (#2328) 2016-10-05 17:33:47 -07:00
Garrett Moon f1bf9be4d8 [Documentation] Add docs for exclusionPaths (#2325)
* Add docs for exclusionPaths

* Clearer, less-infringy
2016-10-05 17:32:44 -07:00
Garrett Moon 409c14890d [Documentation] Improve ASCollectionView docs. (#2317)
* Improve ASCollectionView docs.

* Move note to @note.

* Hannah comments
2016-10-05 17:16:53 -07:00
Garrett Moon 23d1b00a46 Implement ivar on _ASDisplayLayer to speed up getting node from layer. (#2346) 2016-10-05 17:09:08 -07:00
Adlai Holler bb366d14f0 [ASCellNode] Restore Layout Attributes Fix + iOS 10 Modification (#2335)
* [ASCellNode] Fix applyLayoutAttributes not called, add readonly layoutAttributes property (#2321)

* Clear cell node layout attributes in didEndDisplayingCell: also
2016-10-05 17:31:46 -04:00
appleguy 3f1f5667c3 [ASDisplayNode] Add -displayWillStartAsynchronously: method to allow skipping synchronous image cache check. (#2344) 2016-10-05 12:48:54 -04:00
Scott Goodson b928e79cb5 [ASDisplayNode] Optimize pendingDisplayNodes check using isEmpty (ASWeakSet). 2016-10-05 00:13:34 -07:00
Adlai Holler 4dfe2a5a66 [ASAsyncTransaction] Make System Less Specific to Layer Display, More Readable (#2332)
* Make ASAsyncTransaction system less specific to layer-display, more readable

* Document weird import
2016-10-04 20:07:22 -04:00
Michael Schneider 2de129008f Remove dependencies for ASAssert and ASThread in the async transaction system (#2333) 2016-10-04 19:49:14 -04:00
Michael Schneider f369be43dd [Examples] Fix extra examples (#2342)
* Fix

* Add building extra examples to build.sh

* Fix example projects

* Fix CarthageBuildTest

* Export NSArray+Diffing.h to fix life without cocoapods
2016-10-04 19:34:14 -04:00
Garrett Moon 04ed52f995 [Documentation] Improve ASTableView docs. (#2316)
* Improve ASTableView docs.

* Matching ASCollectionView style.
2016-10-04 18:17:23 -04:00
Adlai Holler ba2e12010b [ASCollectionView] Only remeasure all nodes if bounds changed in a fixed dimension (#2343) 2016-10-04 18:12:34 -04:00
ricky 872aad220f [ASTextKitFontSizeAdjuster] Use the constrainedSize’s height to adjust font scaling (#2309)
* refactor shrinking logic

# Conflicts:
#	AsyncDisplayKit/TextKit/ASTextKitFontSizeAdjuster.mm

* fix ASTraitCollection sample

* updated comments.

* fix build errors

* adlai’s comments
2016-10-04 13:01:50 -04:00
Michael Schneider d6e5e27c39 [Layout] Add helper properties for setting sizes via CGSize and ASRelativeSize (#2324)
* Remove set layout style size helper

* Update API to set and get a CGSize / ASRelativeSize from an ASLayoutElementStyle

- Expose ASRelativeSize type
- Add new helper properties to set a size / relative size to ASLayoutElementStyle
- Don't expose the size in ASLayoutElementStyle anymore and move into ASLayoutElementStylePrivate

* Update examples

* Update comments for size helpers
2016-10-04 12:35:45 -04:00
Adlai Holler f027a8be80 Remove ASSentinel (#2336) 2016-10-04 12:22:16 -04:00
appleguy 360541fac5 [ASDisplayNode] Change _pendingDisplayNodes from NSMutableSet to ASWeakSet. (#2340)
In at least some cases, _pendingDisplayNodes referencing self can cause the
object to live longer than the application needs, while tearing down views.

It also appears there may be a cancellation condition where this state is
not balanced properly, which can cause a reference-cycle leak.  This change
safely fixes this problem when tested against a repro case for it.

I'm filing a followup task to make sure all cancellation edge cases have
proper accounting for this codepath, even though the leak is fixed.
2016-10-04 10:22:54 -04:00
Adlai Holler 67045c07b8 Handle nil node blocks gracefully in production (#2338) 2016-10-03 20:06:13 -04:00
Adlai Holler 0a2e35af38 [ASCollectionView] Allow User to Submit Updates Before Initial Data Load (#2337)
* Add tests for how UICV/ASCV will throw if you update before the initial data load

* Allow user to submit updates before initial data load to workaround UICollectionView bug

* Add some info
2016-10-03 19:13:50 -04:00
Garrett Moon 5205ef6840 [API] Remove old deprecated methods. (#2312)
* Remove old deprecated methods. Will restore ones that were removed recently based on PR.

* Update example to use non-deprecated method.

* Don't remove locking / unlocking, insets or willDisplayNode deprecated methods yet.
2016-10-03 14:57:01 -04:00
Scott Goodson a25f4a7b85 Revert "[ASCellNode] Fix applyLayoutAttributes not called, add readonly layoutAttributes property (#2321)"
This reverts commit f9ee1dd4b6.

This appears to have caused a test failure:
https://travis-ci.org/facebook/AsyncDisplayKit/jobs/164532435
2016-10-02 19:36:06 -07:00
Scott Goodson 7fc9f1824a Force xcpretty 0.2.2 instead of new 0.2.3 release that is failing on Travis. 2016-10-02 19:18:20 -07:00
Huy Nguyen 066351bad7 Introduce ASSectionContext and ASSection (#2178)
- Objects conform to ASSectionContext protocol can be provided via ASCollectionDataSource and later retrieved from the collection view. They are guaranteed to be in sync with sections of the collection view. They can be used to store additional data associated with each section, to be used in collection view layout and the like.
- ASSection is an internal object that is the foundation for coming debugging tools.
- Unit tests included.
2016-10-01 14:04:05 -04:00
Hannah Troisi 3f42fcbc7d check button state before changing` (#2323) 2016-09-29 21:22:23 -07:00
Michael Schneider 4692e25204 Add allowsGroupOpacity property to ASDisplayNode (#2320) 2016-09-29 14:30:05 -07:00