469 Commits

Author SHA1 Message Date
Scott Goodson
1e10550951 [Build] Configure Xcode project to reference Precompiled Header. The .podspec changes aren't enough by themselves. 2017-02-04 16:46:37 -08:00
Michael Schneider
12e4e5b048 [Layout] Improve Layout System Abstraction (#2941)
* Improve Layout Abstraction

* Address naming comments

- Rename ASPrimitiveTraitEnvironment to ASTraitEnvironment
- Rename ASPrimitiveTraitCollectionPropagateDown to ASTraitCollectionPropagateDown
- Rename progagateNewPrimitiveTraitCollection: to propagateNewTraitCollection:
2017-02-03 13:04:20 -08:00
Michael Schneider
d42dcfefc1 [ASNodeController] Move ASNodeController to beta header (#2966)
* Move ASNodeController to beta header

* Make it public

* Change ASNodeController+Beta to .mm
2017-02-02 12:51:33 -08:00
Adlai Holler
404795dc02 Remove Support for iOS 7 (#2930)
* Drop support for iOS 7

* Copy reference images

* Update deployment for sample projects

* Update version

* Update "Life Without Cocoapods"
2017-02-01 14:40:37 -08:00
Adlai Holler
d7670780b2 Fix Deleting Sections Issue (#2962)
* Add data source to main project

* Remove the idea of deletingSectionsOfKind – always delete all kinds

* Move comment into assertion
2017-01-31 15:39:10 -08:00
Hannah Troisi
7f7f28385d [ASNodeController] First implementation of node controller class (#2945)
* [ASNodeController] initial commit for node controller class

* create <ASInterfaceState> protocol, -[ASDisplayNode interfaceDelegate], and use these to forward to ASNodeController

* rename ASInterfaceStateDelegate, fix setting in it ASNodeController.mm
2017-01-31 14:27:02 -08:00
Adlai Holler
38aac9d019 IGListKit Support II: Electric Boogaloo (#2942)
* Reimplement IGListKit support in a cleaner way

* Rename and fix some stuff

* Fix supplementaries more

* Update docs

* Update test

* Cleanup minor things

* Tweak it

* Indentation

* Remove irrelevant changes

* Break out cell into its own file

* Fix indentation

* Address feedback
2017-01-30 11:16:59 -08:00
Huy Nguyen
38f1efd448 [ASDataController] Simplify data controller (#2923)
* Start removing ASChangeSetDataController

* Continue removing ASChangeSetDataController

* Remove unnecessary change

* ASDataController is no longer an abstract class, remove its assertion

* Get back beginUpdates and endUpdatesAnimated:completion in ASCollectionNode
2017-01-24 17:41:19 -08:00
Michael Schneider
d9be4783e5 [ASLayout] General Layout Cleanup (#2920)
* Remove duplicate import

* Move `ASLayoutController` related code out of CoreGraphics+ASConvenience

* Further cleanup

* Move private layout files to Privat/Layout

* Move ASLayoutElementStylePrivate into Private/Layout

* Further cleanup

* Move tvOS related files to tvOS folder

* Further cleanup
2017-01-24 11:54:05 -08:00
Huy Nguyen
6736367627 [ASStackLayoutSpec] Refactor baseline alignment algorithm (#2892)
* Add tests for baseline alignments

* Merge baseline alignment algorithm to the main stack algorithm
- Baseline alignment is now part of the main stack algorithm.
- ASStackBaselinePositionedLayout is no longer needed and removed.

* All snapshot test cases of ASStackLayoutSpec are passing now

* Remove baselineRelativeArrangement

* Remove TODO

* Minor fixes in cross size determination step
2017-01-18 11:12:10 -08:00
Leo Tumwattana
4e80acc6e1 [ASEditableTextNode] Maximum number of lines to display (#2777) (#2867)
* WIP

* Calculate TextKit Height based on max lines to display

* Remove TODO

* Calculate height based on lineFragmentRect

* Fixes issue with calculated width

* Resolve TextKit stack threading issues

* Removes blank lines

* Open brace on next line

* setNeedsLayout in case of changes on live node
2017-01-12 13:47:44 -08:00
Michael Schneider
cdf7f70747 [ASDimension] Simplify header file to focus on the most essential types for app developers. (#2794)
* First round of cleanups for ASDimension.mm/h

* Add ASDimensionDeprecated and ASDimensionInternal to Copy Files build phase
2017-01-10 10:05:15 -08:00
appleguy
eeb977e145 [ASDisplayNode] Ensure all subclasses are using base class __instanceLock__ and not re-defining their own. (#2754)
* [ASDisplayNode] Ensure all subclasses are using base class __instanceLock__ and not re-defining their own.

This also moves the @package definition of the instance variable to +FrameworkPrivate instead of Internal.h,
because Internal.h should ideally not be used outside of the ASDisplayNode file setup.  This has greatly reduced
the number of imports of Internal.h.

* [ASDisplayNode] Add ASDisplayNode+FrameworkSubclasses.h to share __instanceLock__ definition.
2016-12-12 19:42:41 -08:00
appleguy
2feabd2832 [ASScrollNode] Support for automaticallyManagesContentSize, adopting the ASLayoutSpec's size as the scrollable contentSize. (#2753)
* [ASScrollNode] Support for automaticallyManagesContentSize, adopting the ASLayoutSpec's size as the scrollable contentSize.

This feature has been desired for a long time, and has turned out to be phenomenally useful and easy to use.

It works well either for a blank ASScrollNode with .layoutSpecBlock set on it, or a subclass of ASScrollNode with a more
traditional layoutSpecThatFits: implementation.  With this approach there is no need to capture the layout size, use
an Absolute layout spec as a wrapper, or set contentSize anywhere in the code and it will update as the layout changes!

There is no automatic management of contentInset, but it would make sense to add this with keyboard listeners in the future.

* [ASScrollNode] Add locking to new properties, adjust how calculateLayout override is done.
2016-12-12 12:03:54 -08:00
Adlai Holler
051b738236 Inject data source class name into update validation exceptions, deprecate suppression flag (#2692) 2016-12-01 17:30:36 -08:00
Adlai Holler
6d01bbeb19 Let nodes deallocate naturally, manually trampoline UIKit ivars
Be more aggressive with main thread punting

Trampoline setting the dataSource/delegate onto the main thread

Short-circuit the supplementary nodes method if no data source

Don't rely on assertions

Mark variable unused to fix release builds

Handle ASCollectionNode/ASTableNode deallocation better

Add some comments about new macro
2016-11-21 00:46:57 +09:00
Garrett Moon
00968ed984 Undo addinng 📦 2016-11-19 15:53:14 -08:00
Garrett Moon
55ba1c5e45 Fix build for life without cocoapods 2016-11-19 15:42:38 -08:00
Garrett Moon
88d0dff09c [ASCollectionView] Move ASCollectionViewLayoutInspector to its own file 2016-11-19 15:14:03 -08:00
Adlai Holler
244ff00152 Fix carthage? 2016-11-16 11:03:55 +09:00
appleguy
55b5dff80c [ASLayoutSpec] Initial commit to support visualizing layout specs (with Playground app). (#2554)
* Initial ASLayoutSpecPlayground commit

* Initial exploratory stab at the main challenge of the app - visualizing ASLayoutSpecs

* Halfway through moving debug features out of ASDK framework files and into debug files. Project builds.

* [ASLayoutSpecPlayground] Created new Inspector node, cleaning up internal implementation to start formalizing support for layout spec visualization.

* Workaround for ensuring creation of visualizerNode for ALL layoutspecs

* continued development

* Layout Inspector Work in Progress

* Resizing the playground works in the shrink direction, not for grow.

* added new ASLayoutableInspectorNode features

* Cleaned up examples code.

* Cleaning up  code.

* more code cleanup

* [ASLayoutableInspector] Transition to an ASTableNode-based architecture to support larger numbers of buttons / customizable types.

* [ASLayoutableInspector] Support different layoutable property types to set up buttons that can edit all of them.

* Huy debugging

* Refactored layout inspector code for extensibility.

* Properly lock layoutableContextMap

* Fix context handling in ASDisplayNode:measureWithSizeRange

* Fix ASLayoutSpecPlayground:ViewController:toggleVisualization

* added slider to InspectorCell

* [ASLayoutSpecPlayground] Improvements to propagation of visualize mode, resize handle, minor cleanup.

* Fix to ASEnvironment

* [ASLayoutSpecPlayground] Fix a few minor issues from the merge with latest master.

* Implement layout spec cache

* add pager ndoe

* add more examples

* add more layout examples

* [ASLayoutPlayground] Fix merge issues

* [ASLayoutPlayground] Fix up the example project from the 2.0 API changes.

* [ASLayoutPlayground] Some fixes (#2411)

* [ASLayoutPlayground]: Some fixes
* Fixed crash when tapping descender.
* Fixed setting the item to inspect.
* Fixed button states in inspector node.
* Added sliders for spacingBefore, spacingAfter, ascender.

* [ASLayoutSpecPlayground] Deselect the buttons when editing is over.

* [ASLayoutSpecPlayground] Changed flexGrow/Shrink's values from YES/NO to 1.0/0.0

* [Project] Create new Debug/ directory for advanced tools dedicated to debugging.

* [LayoutSpecPlayground] Rename project without AS in title, to be consistent with LayoutSpecExamples.

* [Bulid] Fix Xcode project to use new Debug subdirectory / group.

* [Bulid] Fix a small merge error.

* [Build] Fix build issue for Framework target.

* [Bulid] Fix podspec to expose InspectorNode header; Remove old-cocoapods emojis from ASDKgram :)

* Move aside ASLayoutSpecPlayground-Swift to match master

* [LayoutSpecPlayground] Cleanup implementation in several files, xcodeproj, etc.

* [ASControlNode] Add comment for new assertion, to be enabled in a separate diff.
2016-11-08 20:16:16 -08:00
Michael Schneider
2e46aa1e89 Move ASEventLog out of the Private folder (#2580) 2016-11-09 10:41:45 +09:00
Huy Nguyen
fb6d1830a0 Beter table/collection update history (#2562)
- Introduce thread-safe ASEventLog
- ASCollectionNode and ASTableNode share their event log with their ASDataController. The controller uses it to log change set submitting and finishing events.
- ASCollectionNode and ASTableNode print their data source and delegate in their debug description.
2016-11-08 16:44:49 -08:00
Luke Parham
2754af3858 added index of page with node method to ASPagerNode along with some tests (#2561) 2016-11-07 16:07:54 -08:00
Hannah Troisi
8e6f842b8d [ASLayoutElementStyle] implement -description with sizing info (#2495)
* Layout style object debugging

* Remove cocoapods crap
2016-11-01 07:58:43 -07:00
Michael Schneider
4464b7de60 Improve deprecation situation for 2.0 (#2514)
* Improve deprecations for 2.0

- Add deprecations for node / layoutSpec style properties
- Implement missing methods on ASDisplay from deprecation header
- Cleanup all of the deprecation categories

* Remove DeprecatedProtocolMethods

* Fix "Life without Cocoapods"

* Update comments
2016-10-31 16:46:21 -07:00
Tamás Kárai
ca203158da [ASControlNode] Invoke target actions in the same order as they were added (#2456)
* added control node test

* fix tests

* target action pair

* go back to class

* move ASControlTargetAction to Private

* added ASControlTarget to cimpole sources

* add ASControlTargetAction to framework target as well

* init local variables with nil

* removed comment with private Apple class name

* isEqual implementation for ASControlTargetAction

* eliminate retain cycle

* use ASControlTargetAction isEqual

* change to NSMutableOrderedSet

* Use OrderedSet and isEqual

* Use that NSMutableOrderedSet stored the same object only once

* Moving back to NSMutableArray

* minor improvements
2016-10-30 11:44:50 -07:00
Michael Schneider
021f5ebdbb Add initial snapshot tests for ASWrapperSpec (#2482) 2016-10-27 16:27:09 -07:00
Scott Goodson
30a7edf30f [ASLayout] Remove new ASLayoutPrivate.h file and put contents into ASLayoutSpec+Subclasses.h 2016-10-21 13:23:05 -07:00
Michael Schneider
d407663e3f [ASLayout] Improve ASLayout (#2404)
* Add internal header for ASLayout and change position to readonly publicly

* Don't copy sublayouts during tree filtering

* Revert "Don't copy sublayouts during tree filtering"

This reverts commit 6b0d54d5ffe5bb3941ec13696c9c45b0098b6ba1.
2016-10-18 08:36:38 -07:00
Adlai Holler
0ed8ecb677 Test and improve the ASNetworkImageNode progress block handling (#2386) 2016-10-15 17:50:16 -07:00
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
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
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
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
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
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
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
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
appleguy
4364468729 Revert Xcode Project file to before Cocoapods or Xcode 8 changes (seen in https://github.com/facebook/AsyncDisplayKit/pull/2295) (#2307) 2016-09-26 19:43:59 -07:00
Hannah Troisi
679f68e169 upgrade snaphot tests to support IOS 10 (#2295) 2016-09-25 20:53:27 -07:00
Adlai Holler
25de53bb13 [ASDisplayNode] Add Event Tracing to Help Debugging (#2243)
* Add some simple event logging for ASDisplayNode

Improve the tracing

* Add header to copy files phase

* Make event header public
2016-09-15 13:24:19 -07:00
Adlai Holler
5593bfa4d1 [ASDisplayNode] Majorly Improve Descriptions (#2208)
* Up our description game big time

* Couple tweaks

* Explain logic

* Fix indentation
2016-09-07 20:11:27 -07:00
Michael Schneider
8897614f0e [Layout] Layout API based on content area (#2110)
* Initial commit for adding a size constraint to ASLayoutable's

* Some more commits

* Fix sample projects in extra/

* Remove preferredFrameSize test of ASEditableTextNode

* Remove preferredFrameSize from examples_extra

* Add deprecation warning to -[ASDisplayNode preferredFrameSize]

* Add deprecation warning to -[ASDisplayNode measureWithSizeRange:]

* Commit

* Commit

* Remove ASRelativeSizeRange

* Make ASRelativeSize private

* Adjust examples

* Improve setting of -[ASLayoutable size] with points or fractions

* Add ASWrapperLayoutSpec

* Improve creation of ASRelativeDimension

* Add `preferredFrameSize` back and add deprecated logging

* Add `layoutSpecBlock` setter and getter and add locking for it

* Add better documentation and fix macros to create ASRelativeDimension

* Create new ASSizeRangeMake with just a CGSize as parameter

* Update Kitten and Social App Layout example

* Add layoutThatFits: and deprecate measure:

* Rename ASRelativeDimension to ASDimension

* Fix examples for ASDimension renaming

* Remove fancy height and width setter

* Fix ASDimension helper

* Rename -[ASLayout layoutableObject] to -[ASLayout layoutable]

* Update layout related methods and more clearer documentation around how to use it

* Deprecate old ASLayout class constructors

* Don't unnecessary recalculate layout if constrained or parent size did not change

* Use shared pointer for ASDisplayNodeLayout

* Fix rebase conflicts

* Add documentation and move implementation in mm file of ASDisplayNodeLayout

* Fix test errors

* Rename ASSize to ASLayoutableSize

* Address comments

* Rename setSizeFromCGSize to setSizeWithCGSize

* Improve inline functions in ASDimension

* Fix rebase conflicts
2016-09-07 08:44:48 -07:00
Michael Schneider
2388f67474 [ASTextNode] Add NSCache based cache for ASTextKitRenderer (#2199)
* Add cache implementation

* Remove old ASEqualityHashHelpers

* Some more ASEquality and ASEqualityHashHelper cleanup

* Add cache for text renderer in ASTextNode

* Move from C++ LRU renderer cache to NSCache based renderer cache
2016-09-06 15:23:21 -07:00
Adlai Holler
5c42bb4e2f Add tests to confirm CALayer behaviors (#2184) 2016-09-02 15:10:15 -07:00