2498 Commits

Author SHA1 Message Date
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 f9ee1dd4b6b4d8a062c5453623bc6fde1840cd91.

This appears to have caused a test failure:
https://travis-ci.org/facebook/AsyncDisplayKit/jobs/164532435
2016-10-02 19:36:06 -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
Adlai Holler
f9ee1dd4b6 [ASCellNode] Fix applyLayoutAttributes not called, add readonly layoutAttributes property (#2321) 2016-09-29 16:41:28 -04:00
Hannah Troisi
47f73576ef [Layout] Rename ASStackLayoutable to ASStackLayoutElement (#2322)
* redo all renaming, push new branch

* rename a few missed occurances of static
2016-09-29 12:29:21 -07:00
Hannah Troisi
7551627b58 [Layout] Rename ASLayoutable to ASLayoutElement (#2290)
* [Layout API] Rename ASLayoutable to ASLayoutElement

* arg

* fix wrapperWithLayoutElement

* [Layout API] Rename ASLayoutable to ASLayoutElement

* arg

* address Michael's comments

* Remove ASLayoutValidation files that were deleted on master since this diff was created.
2016-09-29 00:02:47 -07:00
Michael Schneider
1abc1a833c Remove legacy layout validation code (#2311) 2016-09-28 16:46:31 -07:00
Garrett Moon
5cd8f28ad5 @return is recognized by the syntax highlighter. (#2313) 2016-09-28 14:40:05 -07:00
Michael Schneider
4aa7c9631d Disable ASTextKitRenderer cache (#2315) 2016-09-28 16:42:06 -04:00
Hannah Troisi
87595c7d3b [Layout API] Rename ASStaticLayoutSpec to ASAbsoluteLayoutSpec (#2288)
* Rename static to absolute

* Fix examples, rename ASAbsoluteLayoutSpec class method

* rename +staticLayoutSpecWithChildren to +absoluteLayoutSpecWithChildren

* address Michael's comments
2016-09-28 13:05:31 -04:00
Michael Schneider
2f99951732 [Layout] Move [ASLayoutSpec children] from std::map to NSMutableArray (#2253)
* Initial commit to move [ASLayoutSpec children] from std::map to NSMutableArray

* Add NSFastEnumeration to ASLayoutable

* ASNullLayoutSpec is a Singleton now

* Move ASLayoutSpecPrivate in Private folder

* Move to NSArrayPointer and remove ASNullLayoutSpec

* Revert "Move to NSArrayPointer and remove ASNullLayoutSpec"

This reverts commit 9ab9cf7024b1f6e1984d84fe58af2b84e84cdf94.

* Move to childAtIndex: and setChild:atIndex:
2016-09-27 19:41:45 -04:00
Adlai Holler
8a4d4e3b5c Simplify/optimize rounded image generation (#2292) 2016-09-27 18:42:46 -04:00
Michael Schneider
e85583523f [Layout] Add support for flex factor (#2298)
* Add support for flex factor

* Add snapshot tests

* Respect child specified size from ASLayoutable

* Add new snapshot test images

* Fix rebase conflict
2016-09-27 18:39:50 -04:00
Adlai Holler
f421787cd3 Add some nullability specifiers to our public headers (#2291) 2016-09-27 18:15:04 -04:00
Adlai Holler
ec64b9b229 [ASDataController] Call All Completion Handlers after Nested Batch Updates (#2274)
* Add tests for batch update completion handler calling

* Ensure we call all completion handlers after collection view updates

* Tweak it

* Fix the doc

* Minor improvements

* Document addCompletionHandler better
2016-09-27 17:21:28 -04:00
Michael Schneider
416d8f92e1 [Layout] Add delegate to ASLayoutableStyle for property changes (#2283)
* Add delegate to ASLayoutableStyle for property changes

* Moving ASLayoutableStyle delegate to readonly

* Add ASLayoutableStyleTests

* Fix property stirngs

* Fix video example

* Address comments of Adlai
2016-09-27 16:50:36 -04:00
Michael Schneider
f574f2c54e [Layout] Further deprecation steps for preferredFrameSize (#2255)
* Deprecate preferredFrameSize

- Remove all support for preferredFrameSize in ASDK
- preferredFrameSize setter calls through and sets the width and height of the node
- preferredFrameSize getter tries to return a CGSize based on the width and height properties otherwise if this is not possible it throws

* Address comments

* Return CGSizeZero for preferredFrameSize unless width and height are ASDimensionUnitPoints

* Better comment for preferredFrameSize and remove lock in calculateSizeThatFits:
2016-09-27 16:07:36 -04:00
Garrett Moon
d909a8af01 I don't believe it's safe to return a vector by reference created in a function. (#2286) 2016-09-26 17:41:58 -04:00
Adlai Holler
4326fc90bf Pass the cell node through in willDisplay: table/collection callbacks (#2282) 2016-09-23 19:50:53 -04:00
Adlai Holler
ce1d21dc63 [ASCellNode] Document cell node event callback behavior for plain-node cases (#2281) 2016-09-23 13:30:30 -04:00