50 Commits

Author SHA1 Message Date
appleguy
465abb1ded [License] Simplify the Texture license to be pure Apache 2 (removing ASDK-Licenses). (#1077)
* [License] Simplify the Texture license to be pure Apache 2 (removing ASDK-Licenses)

With permission of the Facebook Open Source team, we are simplifying the Texture
license so that clients can rely on the Apache 2 terms that most of Texture is
already covered by. This means that code originally forked from AsyncDisplayKit
will be re-licensed from "BSD 3-clause + PATENTS v2" to Apache 2 without a
PATENTS file.

After getting confirmation that the updates to these core files look good, we'll
propagate this new license header to all files (in this same PR) and get sign-off
from all parties before landing.

* [License] Update all Texture source files to be pure Apache 2.

* Changelog entry for Apache 2 license update.

* Revert "[License] Update all Texture source files to be pure Apache 2."

This reverts commit ffa0fbbba9717d871dd16c4b07539f2f8208fc2b.

* [License] Update all Texture source files to be pure Apache 2, maintaining copyrights.

* [License] Update CONTRIBUTING, README, Podspec & Dangerfile.
2018-08-28 07:39:18 -07:00
Adlai Holler
61dade6bda Raise deployment target to iOS 9 (#743)
https://github.com/TextureGroup/Texture/pull/743

Manually merged since I forgot to retarget that diff onto master before merge
2018-01-15 15:13:05 -08:00
Adlai Holler
5e73396cde
Enable collection node interactive moves (#735)
* Add support for interactive moves

* Enable drag & drop in collection view example

* Update changelog

* Change the gating logic to match UIKit

* Add a warning when we prevent interactive movement due to async layout
2018-01-09 14:34:32 -08:00
Huy Nguyen
d4b1f625aa [Gallery layout] Include the caller in properties providing methods (#533)
* Include the caller in ASCollectionGalleryLayoutPropertiesProviding's methods

* Update CHANGELOG.md
2017-09-08 17:05:06 +01:00
Huy Nguyen
afeb25a6b4 [examples/ASCollectionView] Register supplementary kinds (#508) 2017-08-14 16:52:45 +01:00
Max Wang
a929950d2c Fix SIMULATE_WEB_RESPONSE not imported (#450)
* fix SIMULATE_WEB_RESPONSE not imported (Reported in #449).

* changes per review

* Update license of ViewController.m
2017-08-14 16:31:52 +01:00
Huy Nguyen
fdc1f0468c Improvements in ASCollectionGalleryLayoutDelegate (#496)
* Improvements in ASCollectionGalleryLayoutDelegate
- It now can handle section inset, as well as interitem and line spacings
- Other small changes

* Fix build failure and update file licenses

* Update CHANGELOG

* Minor change

* Another assertion on scrollable directions of gallery layout delegate
2017-08-08 19:11:40 +01:00
Huy Nguyen
78c133e44c [ASCollectionLayout] Add ASCollectionGalleryLayoutSizeProviding (#451)
* Add ASCollectionGalleryLayoutSizeProviding
- This allows users to return different sizes based on certain conditions, such as the collection node's bounds or grid constants.
- ASPagerNode will also act as a size provider to ensure all pages have an up-to-date size that is its bounds.

* Update CHANGELOG

* ASPagerNode to use gallery layout delegate if told to
2017-07-18 10:08:12 +00:00
Huy Nguyen
3ccc2f0f15 Introduce ASCollectionGalleryLayoutDelegate (#76)
* Implement ASCollectionGalleryLayoutDelegate
- It arranges items of the same size into a multi-line stack (say photo gallery or pager). It takes advantage of the fact that its items always have a fixed size to measure as few items as possible while still being able to track their positions at all time. This helps reduce startup/reloadData time, as well as memory footprint.
- It then uses a measure range, which also works as a allocate range, to figure out which items to measure ahead of time. And it guarantees that each item is scheduled to measure only once.
- Lastly, ASCollectionLayoutDelegate has some new methods that allow delegates to hook up and stay ahead of layout attributes requests from the backing view. ASCollectionGalleryLayoutDelegate for example uses these methods to ensure elements that have their layout attributes requested are always ready for consumption, and to measure more elements in the background.

* Handle items that span multiple pages and other improvements in gallery delegate

* Minor fixes

* Fix failing tests

* Fix custom collection example

* Implement missing method in gallery layout delegate

* Fix warnings

* Some improvements
- Collection layout delegates must have a crollable directions property.
- Simplify gallery delegate by not storing unmeasured attributes since calling measure on already measured elements should be cache hits and super fast.
- Abstact some code in gallery delegate to ASCollectionLayoutState+Private and _ASCollectionGalleryLayoutItem.
- Other improvements in gallery delegate

* Fix file licenses

* Move measure range logic to ASCollectionLayout

* Track unmeasured elements

* Remove pending layout in ASCollectionLayout

* Get back pending layout because the timing to latch new data is not ideal

* Add ASCollectionLayoutCache

* Fix file licenses

* Fix xcodeproj

* Add async collection layout to examples/ASCollectionView

* Measure method in ASCollectionLayout to be a class method

* Encourage more immutable states
- Make -calculateLayoutWithContext: to be class methods in ASDataControllerLayoutDelegate and ASCollectionLayoutDelegate.
- Add layout delegate class and layout cache to ASCollectionLayoutContext+Private, to be use by ASCollectionLayout only.
- ASDataController no longer allocates all nodes but lets ASCollectionLayout determine.
- Add scrollableDirections to the layout context since it's often needed by the layout pass. Otherwise users have to wrap it in an info object.
- Update built-in layout delegates and CustomCollectionView example.
- Publish ASHashing. It might be helpful for clients that implement custom collection info objects.

* Remove additionalInfo property in ASCollectionLayoutState

* ASCollectionLayoutState to correctly filter unmeasured elements

* Add ASHashing to umbrella header

* Fix file licenses

* Add ASDispatchAsync and use it in ASCollectionLayout

* Improve code comment in ASCollectionLayoutState
2017-07-14 18:50:26 +00:00
Garrett Moon
caace4f98b More example fixes 2017-04-14 09:37:38 -07:00
Garrett Moon
3522c81d5e Update examples 2017-04-14 09:37:38 -07:00
Huy Nguyen
7d365c7d07 Introduce ASCollectionLayout and friends (#3130)
* Introduce ASCollectionViewLayout
- `ASCollectionViewLayout` is an async `UICollectionViewLayout` that encapsulates its layout calculation logic into a separate thread-safe object which can be used ahead of time and/or on multiple threads.
- `ASDataController` now can prepare for a new layout resulted from a change set before `ASCollectionView` even knows about it. By the time the change set it ready to be consumed by `ASCollectionView`, its new layout is also ready.
- New `ASCollectionViewLayoutCalculating` protocol that is simple and generic enough that many types of calculators can be built on top. `ASCollectionViewLayoutSpecCalculator` conforms to `ASCollectionViewLayoutCalculating` protocol and can be backed by any layout spec (e.g `ASStackLayoutSpec`, `PIMasonryLayoutSpec`, etc). We can even build a `ASCollectionViewLayoutYogaCalculator` that uses Yoga internally.
- A built-in `ASCollectionViewFlowLayoutCalculator` that is a subclass of `ASCollectionViewLayoutSpecCalculator` and uses a multi-threaded multi-line `ASStackLayoutSpec` internally. The result is a performant and thread-safe flow layout calculator.
- Finally, `ASCollectionViewLayout` can be subclassed to handle a specific type of calculator with optimizations implemented based on the knowledge of such calculator. For example, `ASCollectionViewFlowLayout` can have a highly optimized implementation of `-layoutAttributesForElementsInRect:`.

Protocolize layout calculator providing and consuming

Add flex wrap documentation

Add a `multithreaded` flag to ASStackLayoutSpec that forces it to dispatch even if it's off main
- Update ASCollectionViewFlowLayoutSpecCalculator to use that flag.

Minor change in ASCollectionViewLayout

Implement Mosaic layout calculator

Minor change

Fix project file

Rename and fix project file

Skip fetching constrained size only if a layout calculator is available

Update examples/ASCollectionView

Remove unnecessary change in ASTableView

Address comments

Rename collection view calculator protocols

Minor changes after rebasing with master

Add ASLegacyCollectionLayoutCalculator for backward compatibility

Remove ASCollectionLayoutSpecCalculator

Remove ASLegacyCollectionLayoutCalculator

Introduce ASCollectionLayout
- A wrapper object that contains content size and an element to rect table.
- Collection layout calculators to return this new object instead of an ASLayout.

Before adding a content cache

Finishing hooking up ASCollectionLayoutDataSource to ASCollectionNode

Stash

Finish ASCollectionLayout

Rough impl of ASCollectionFlowLayout

Revert changes in CustomCollectionView example

Move ASRectTable back to Private

* Rename ASCollectionContentAttributes to ASCollectionLayoutState

* Address other comments

* Introduce ASCollectionLayoutDelegate and make ASCollectionLayout private

* Address comments

* API tweaks:
- Replace `-layoutContextWithElementMap:` in ASCollectionLayoutDelegate with `-additionalInfoForLayoutWithElements:`. The returned object is then stored in ASCollectionLayoutContext for later lookups.
- ASCollectionLayoutContext has no public initializer.
- ASDataControllerLayoutDelegate no longer requires a context of type ASCollectionLayoutContext but simply an `id`. This helps decouple ASDataController and ASCollectionLayout.
- Rename `elementMap` to `elements`.
- Rename `visibleMap` to `visibleElements`.
- Other minor changes.

* Rename ASCGSizeHash to ASHashFromCGSize

* Make sure to call super in -[ASCollectionLayout prepareLayout]

* Update example/ASCollectionView to use ASCollectionFlowLayoutDelegate

* Remove unnecessary change
2017-04-12 11:13:44 +01: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
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
Hannah Troisi
5f9e84ce28 [Examples] fix CustomCollectionView-Swift project configs (#2671)
* fix podfile

* add Sample scheme

* remove example project workspace files

* remove use_frameworks!

* add Sample scheme

* add use_frameworks! back in

* add scrollableDirections method
2016-11-28 15:33:29 -08:00
Austin Louden
ae11fc755e Update deprecations in ASCollectionView example, enable warnings (#2594)
* Update example deprecations and flags

* update podfile
2016-11-10 22:42:37 -08:00
Hannah Troisi
9949c6348d [Examples] update example projects to 2.0 API (#2568)
* update example projects to latest Collection / Table API

* udpate delegate / data source methods
2016-11-07 15:55:09 -08:00
Hannah Troisi
0dd170dde4 clean up ASCollectionView example project (#2384) 2016-10-20 17:10:20 -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
Adlai Holler
5e3627a9cd [ASTextNode] Actually deprecate attributedString property (#2151) 2016-09-01 16:43:03 -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
rcancro
9d622c7eac changed DisplayTraits to TraitCollection 2016-05-10 14:45:03 -07:00
Scott Goodson
15a4e18844 [Examples] Officially add tvOS to podspec, ensure Podfiles correctly show minimum supported version 7.0 instead of 7.1 2016-04-22 20:29:52 -07:00
Michael Schneider
563e52bb6a Fix Podfile is missing target for samples 2016-04-21 11:07:08 -07:00
Michael Schneider
9291372c7f Show status bar in examples 2016-03-02 06:53:55 -08:00
Michael Schneider
bb35470c72 Overall examples improvement 2016-02-24 20:21:42 -08:00
Michael Schneider
8418d8be24 Use collectionView:nodeBlockForItemAtIndexPath: in all examples 2016-02-24 20:17:18 -08:00
Scott Goodson
ca57059322 New ASDelegateProxy class to unify logic for Table & Collection forwarding. Fix dealloc-during-animation crash. 2015-12-23 20:01:52 -08:00
Scott Goodson
a47a1b8c2a Bump podspec to 1.9.3. Remove Cocoapods-generated workspace files. 2015-12-06 20:32:21 -08:00
Levi McCallum
e6b33dd062 Fix cell selection and highlighting in ASCollectionView 2015-11-11 01:05:51 -08:00
Scott Goodson
fdcace6061 Add multiple view push to the ASTableViewStressTest app to evaluate memory issues
No issues found.  Have not been able to create a leak either with the test itself
or scrolling / popping back view controlliers.
2015-11-01 10:54:11 -08:00
Scott Goodson
59c1a642ba Add reload button to ASViewController demo for memory testing. 2015-10-31 16:53:56 -07:00
Scott Goodson
2e331656cf Add "Push Another Copy" to ASViewController demo for memory testing.
So far unable to reproduce the reports of rows or items not being released.
2015-10-31 16:40:26 -07:00
Levi McCallum
ee0cc2001a Add support for loaded node layout for supplementary views 2015-10-15 11:40:52 -07:00
Levi McCallum
a9023dd400 Fix layout of example supplementary nodes 2015-10-15 11:40:52 -07:00
Levi McCallum
fddb0061b0 Use ASCellNodes for supplementary nodes 2015-10-15 11:40:52 -07:00
Levi McCallum
e410595f42 Add functioning header/footer supplementary view support to example 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
da7a2a5d48 Further implement data controller support and layout introspection 2015-10-15 11:40:49 -07:00
Levi McCallum
e492770aed Expose collection view supplementary node data source method 2015-10-15 11:38:48 -07:00
Levi McCallum
0d2332bd82 Allow ASCollectionView to register for supplementary container 2015-10-15 11:38:48 -07:00
Levi McCallum
4e32c075d4 Add launch storyboard to collection view example to fix screen size 2015-10-15 11:38:47 -07:00
Levi McCallum
2956c0cd8a Extract flow layout methods into a separate delegate 2015-10-15 11:38:47 -07:00
Adlai Holler
b1dfaa1eff Update project indentation settings 2015-09-16 14:17:52 -07:00
Levi McCallum
5eb75d6bc7 Add support for sectionInset in ASCollectionView in property and delegate form 2015-08-03 14:36:29 -07:00
Nadine Salter
9eff356a61 [travis] Shared schemes for all example projects. 2015-03-20 15:36:31 -07:00
Ryan Nystrom
c657411a2e Batch fetch with small data sets 2015-02-26 22:29:13 -08:00
Ryan Nystrom
1f8001a104 ASCollectionView batch API 2015-02-26 22:24:46 -08:00
Li Tan
831aa47ae0 Address comments 2015-02-11 19:15:08 -08:00
Nadine Salter
ee3aec42a2 Tidy ASCollectionView sample project. 2014-11-18 14:14:28 -08:00