41 Commits
Author SHA1 Message Date
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
Adlai Holler 295ed22c23 Improve Our Handling of Flow Layout Headers/Footers (#2939)
* Rejigger our flow layout supplementary support to make more sense.

* Support old protocol

* Update

* Update deprecation message

* Undeprecate insetForSection method, because it actually _does_ still work

* Update the tests

* Remove irrelevant junk

* Remove cast, add pragma
2017-01-27 15:58:43 -08:00
Adlai Holler e69a475d2b Minor Collection Simplifications (#2906)
* Minor collection simplifications

* Remove didChangeCollectionViewDataSource call, restrict subclassing ASCollectionViewFlowLayoutInspector
2017-01-19 13:57:03 -08:00
Garrett Moon 88d0dff09c [ASCollectionView] Move ASCollectionViewLayoutInspector to its own file 2016-11-19 15:14:03 -08:00
Hannah Troisi edf2b669ae [ASCollectionViewLayoutInspecting] make -scrollableDirections required (#2543)
* [ASCollectionViewLayoutInspecting] make -scrollableDirections a required method

* doh!

* fixed?

* add assert per @appleguy's comment

* use self.layoutInspector, add check at the start of didChangeBounds...
2016-11-09 13:48:16 +09:00
Adlai Holler d0421195eb Make flow layout inspector call the new constrainedSize method (#2444) 2016-10-20 14:32:01 -07:00
Adlai Holler 67489492ee Fix Uncalled Collection Delegate Methods (#2433)
* Fix batch fetching

* Fix not calling constrainedSizeForItemAtIndexPath:

* Fix constrainedSizeForItemAtIndexPath: not being called
2016-10-19 11:49:49 -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
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 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
Huy Nguyen 6124830b23 Fix assertion messages in ASCollectionViewFlowLayoutInspector (#2196) 2016-09-06 11:43:13 -07:00
Michael Schneider 1849c41b03 Add assert for ASCollectionDataSource implementing collectionView:constrainedSizeForNodeAtIndexPath: instead of ASCollectionDelegate (#2165) 2016-08-29 16:44:11 -07:00
Adlai Holler 0bd664f9ed Remove numberOfSectionsForSupplementaryNodeOfKind: Method (#2102)
* Add unit test to confirm that supplementary items must be contained within actual sections

* [ASLayoutInspecting] Deprecate collectionView:numberOfSectionsForSupplementaryNodeOfKind:

* Add another test to dig deeper into UICollectionView
2016-08-19 11:18:31 -07:00
Michael Schneider 93be894e0c [ASCollectionView / ASPagerNode] Move constrainedSizeForNodeAtIndexPath from the DataSource to the Delegate (#2065)
* Move constrainedSizeForNodeAtIndexPath from the DataSource to the Delegate in ASCollectionView and ASPagerNode

* Fix ASPagerNode declaration of dataSource and delegate

As ASPagerDataSource does not inherit from ASCollectionDataSource it's not possible to declare it as property.

* Update comment
2016-08-12 15:37:23 -07:00
Yue-Wang-Google 93a5c36a39 Fixed typo in ASCollectionViewFlowLayoutInspector.m pertaining to supplementary node layout. (#1996)
Patch from iOS teams at Google Inc.
2016-07-28 10:13:49 -07:00
Michael Schneider 8b3ec83bfd Small name changes 2016-07-13 16:36:48 -07:00
Michael Schneider 30bb2ee93d Address comments from @levi 2016-07-13 16:36:48 -07:00
Michael Schneider 9fb3129a0e Add default ASCollectionViewLayoutInspecting for custom ASCollectionViewLayout 2016-07-13 16:36:48 -07:00
Michael Schneider 35c860c183 Refactor usage of ASCollectionViewLayoutInspecting
- Fix not using itemSize of UICollectionViewFlowLayout
- Move automatic constrained size calculation to the ASCollectionViewFlowLayoutInspector
- Provide a null layout inspector for throwing exceptions if a custom
  UICollectionView is given but no ASCollectionViewLayoutInspecting
- Fix not checking for optional layout inspecting data source methods
  are implemented or not
- Improving tests around ASCollectionViewLayoutInspecting
2016-07-13 16:36:48 -07:00
Hannah Troisi c857e809f4 Clean up header comments (for consistent Facebook licensing info) (#1741)
[Licensing] Clean up header comments (for consistent Facebook licensing info)
2016-06-11 23:31:39 -07:00
appleguy 4804f429b9 Revert "[ASCollectionView] Add a "Null Object" for a layout inspector if custom layout is given but no layout inspector" (#1713) 2016-06-04 22:49:10 -07:00
Michael Schneider 00d9372ee4 Add a "Null Object" for a layout inspector if no no flow layout is given
The purpose of the ASCollectionViewCustomLayoutInspector is to provide a default implementation if given a custom layout, but no layout inspector.
2016-06-04 13:58:23 -07:00
Eric Jensen 33fda7ab49 - Use modern Objective-C syntax.
-  Simplify comparisons.
-  Remove dead stores.
2016-03-15 22:34:29 -07:00
Scott Goodson a2cf2a88e6 Overhaul header files / includes to eliminate circular references that Xcode 7 is angry about. 2015-12-25 19:22:00 -08:00
Scott Goodson 7ece41ff64 Delegate definition tweaks for Table and Collection; ensure Table tests run with ARC enabled. 2015-12-24 21:41:12 -08:00
Levi McCallum 36d24950e0 Add custom collection view layout example project 2015-11-27 18:58:44 -08:00
Levi McCallum 6569893c23 Reset inspector selector implementation cache correctly 2015-10-22 18:54:07 -07:00
Levi McCallum e8ce7fcbb2 Clean up caching of collection view delegate selectors on the inspector 2015-10-21 23:17:38 -07:00
Levi McCallum 5645724984 Use pointer comparison helpers for string equality 2015-10-21 23:17:37 -07:00
Levi McCallum ad82c72eb4 Cache flow layout delegate in local variable 2015-10-21 23:17:37 -07:00
Levi McCallum 413307a973 Assert flow layout inspector always initializes with a flow layout 2015-10-21 23:17:37 -07:00
Levi McCallum 12194199cd Clean up layout delegate protocol API 2015-10-15 11:40:53 -07:00
Levi McCallum e2bbde2a4e Clean up usage of internal flow layout inspector 2015-10-15 11:40:53 -07:00
Levi McCallum ba72c73779 Clarify default value behavior of the layoutDelegate for flow layouts 2015-10-15 11:40:52 -07:00
Levi McCallum 432136740f Constrain flow layout header/footer size to collection view bounds 2015-10-15 11:40:51 -07:00
Levi McCallum 8efca60bac Handle initial sizing delegate implementation in flow layout inspector 2015-10-15 11:40:50 -07:00
Levi McCallum afda471bd0 Clean up interfacing with internal editing/completed stores 2015-10-15 11:40:50 -07:00
Levi McCallum c9f93cde76 Update copywright preamble 2015-10-15 11:40:49 -07:00
Levi McCallum 73ddebed81 Implement UICollectionViewFlowLayout heuristics in a default inspector 2015-10-15 11:40:49 -07:00
Levi McCallum 5dee3f62cc Extract number of supplementary sections into the inspector 2015-10-15 11:40:49 -07:00
Levi McCallum da7a2a5d48 Further implement data controller support and layout introspection 2015-10-15 11:40:49 -07:00