144 Commits

Author SHA1 Message Date
Huy Nguyen
8c45eaefce [Batch Fetching] Add ASBatchFetchingDelegate (#281)
* Add ASBatchFetchingDelegate
- In addition to checking remaining leading screens, ASBatchFetching now also calculates a remaining time and consults its delegate if needed.
- The delegate can override the decision of ASBatchFetching, for example based on remaining time and average time of past batch requests.

* Fix up tests

* Update CHANGELOG
2017-05-17 13:26:30 +01:00
Adlai Holler
432018cfdc Ignore Relayout Requests for Deleted Cell Nodes (#279)
* Data Controller: Ignore relayout requests for elements that have been deleted in the mean-time.

* Bolster our logchange

* Add sanity check
2017-05-16 11:31:15 -07:00
Adlai Holler
9c07aff695 Remove unused cell node method (#278) 2017-05-15 16:36:29 -07:00
Adlai Holler
7df1a20c5f Simplify Layout Transition State #trivial (#269)
* Port the changes to the latest master

* Remove extra s
2017-05-15 16:33:44 -07:00
Adlai Holler
a1b6fd2cd7 Fix documentation warnings (#276) 2017-05-15 13:31:20 -07:00
Michael Schneider
b32e69d64b [Layout] Extract layout implementation code into it's own subcategories (#272)
* Extract layout code into ASDisplayNode categories

* Category renaming and documentation

* Changelog

* Change header
2017-05-15 11:10:59 -07:00
Adlai Holler
9d84b9e635 Fix release builds (#271) 2017-05-14 15:52:06 -07:00
Adlai Holler
d4725a51f2 Add Experimental Text Node Implementation (#259)
* Add experimental text node implementation, based on YYText

* Fix warnings and alert when unimplemented experimental features are used.

* Address feedback from review

* Extend the cthulog

* Update license headers
2017-05-14 12:02:07 -07:00
Adlai Holler
6d113f7a9d Use pthreads to back ASLayoutElementContext instead of std::map (#268) 2017-05-14 10:08:22 -07:00
Adlai Holler
538a02f119 Simplify Override Checking, Only Do It When Assertions Are Enabled #trivial (#253)
* Simplify our override checking, only do it when assertions are enabled

* Move those functions under the ASSERTIONS_ENABLED check
2017-05-11 11:42:15 -07:00
Adlai Holler
f2c85fdc32 Fix Collection Item Index Path Conversion (#262)
* Fix the conversion order for collection index paths

* Update the changelog
2017-05-11 10:44:21 -07:00
Sergey Petrachkov
4b114e841b added error reporting callback to ASVideoNode (#260)
* added error reporting callback to ASVideoNode

* updated Changelog.md

* updated code according to review notes:

- preserved two-spaces indentation;
- extended error reporting callback with key and asset, updated method call;
2017-05-11 12:23:12 +01:00
ricky
002f470331 [ASTextKitFontSizeAdjuster] Replace use of boundingRectWithSize:options:context: with boundingRectForGlyphRange: inTextContainer: (#251)
* [ASTextKitFontSizeAdjuster] Replace use of boundingRectWithSize:options:context: with boundingRectForGlyphRange: inTextContainer:

`boundingRectWithSize:options:context:`  started returning different values for the same strings between iOS 10.2 and iOS 10.3. Switching to using `NSLayoutManager`’s `boundingRectForGlyphRange: inTextContainer:` fixed this. It also makes sure we are consistent with what `ASTextKitTailTruncater` uses.

* updated changelog
2017-05-10 18:40:22 -07:00
Huy Nguyen
34397235bb Add missing import and define in ASLog (#257) 2017-05-10 17:09:07 -07:00
Adlai Holler
0143e3291a Improve Ancestry Handling, Avoid Assertion Failure (#246)
* Improve our handling of ancestry

* Increase chungalunga
2017-05-09 18:27:54 -07:00
Michael Schneider
4dbbba7d32 Remove instance method of -drawRect:withParameters:isCancelled:isRasterizing: (#232) 2017-05-09 14:02:33 -07:00
Michael Schneider
3738f1f6e2 [ASImageNode] Move to class method of displayWithParameters:isCancelled: for drawing (#244)
* Remove instance displayWithParameters:isCancelled:

* Address comments
2017-05-09 13:03:30 -07:00
Michael Schneider
8692428481 [ASDisplayNode] Pass drawParameter in rendering context callbacks (#248)
* Pass drawParameter in rendering context callbacks

* Add changelog

* Fix examples
2017-05-08 14:39:40 -07:00
Alejandro Megías
ad9924abd8 [ASDimension] Remove warning about float precision using CGFloat and Double (#237)
[ASDimension] Remove warning about float precision using CGFloat and … #trivial
2017-05-08 14:12:12 -07:00
Garrett Moon
850aeb442c Assert only once we know URL has changed (#247)
We need this in case someone is setting the URL to nil before setting
the image directly. I.e. they have a node which has been used as a network
node or an image node but now they want it to be an image node.

They should then set the URL to nil and then set the image.
*if* it was used as a network node previously, this would work.
If it was previously used as an image node it would historically assert.
This addresses that.
2017-05-05 16:32:54 -07:00
Adlai Holler
80357b1c7c Don't use associated objects for ASDisplayNode.drawingPriority (#239) 2017-05-05 08:22:30 -07:00
Michael Schneider
17d956493a [ASImageNode] Move debug label and will- / didDisplayNodeContentWithRenderingContext out of drawing method #trivial (#235)
* Move configuring the debug label from the drawing method in displayDidFinish

* Move will- and didDisplayNodeContentWithRenderingContext in drawing parameters
2017-05-04 16:56:26 -07:00
Adlai Holler
588f30c7dd Move Last Few Properties from ASTableView,ASCollectionView to Node (#225)
* Finish moving properties ASTableView->ASTableNode, ASCollectionView->ASCollectionNode

* Update changeling
2017-05-04 13:41:58 +01:00
Michael Schneider
25da46c8ac Remove unneeded pointer star (#231) 2017-05-04 13:41:35 +01:00
Huy Nguyen
ca2885cf06 Implement ASPageTable (#81)
* Implement ASPageTable
- It is a screen page table that can be used to quickly filter out objects in a certain rect without checking each and every one of them.
- ASCollectionLayoutState generates and keeps a table that maps page to layout attributes within that page.
- ASCollectionLayout (and later, ASCollectionGalleryLayoutDelegate) consults its layout state for `layoutAttributesForElementsInRect:`. This ensures the method can return as quickly as possible, especially on a large data set (I heard some people have galleries with thousands of photos!).

* Address comments

* Handle items that span multiple pages

* Make danger happy
2017-05-04 12:43:02 +01:00
appleguy
98a8c38ce2 [ASTwoDimensionalArrayUtils] Fix extern C function definition to fix compiler issue. (#229)
In some build environments, this causes an error. It seems to be a change since 2.2.
2017-05-03 15:58:03 -07:00
Michael Schneider
82b7806473 [Layout] Remove finalLayoutElement (#96)
* Remove finalLayoutElement

* Add changelog

* Remove some documentation
2017-05-03 10:45:01 -07:00
Michael Schneider
b6734faa3b Extract ASLayoutElement and ASLayoutElementStylability into categories #trivial (#131)
* Initial move of code into layout category

* Cleanup

* Some more
2017-05-02 14:38:06 -07:00
Adlai Holler
a7656766f9 Make Cell Node Properties Atomic (#74)
* Make ASCellNode indexPath and supplementaryElementKind atomic

* Update the change log

* Fix licenses

* Be explicit with atomic

* Rename the protocol

* And the file
2017-05-02 14:09:12 -07:00
Phil Larson
471f02daa7 Automatically resume ASVideoNode after returning from background (#13) 2017-05-02 13:13:16 -07:00
Adlai Holler
b1e1bfda20 Improve Our Handling of Subnodes (#223)
* Improve the subnodes/fast enumeration situation

* Increment changlag

* Assert our subnodes match
2017-05-02 13:02:07 -07:00
appleguy
71d5b3205d [ASNodeController+Beta] Provide an option to allow nodes to own their controllers. (#61)
* [ASNodeController+Beta] Provide an option to allow nodes to own their controllers.

We should certainly remove this before moving ASNodeController out of Beta. However, I think
it will require at least ASCollectionNode to be able to retain its top level set of node controllers.

Without this facility built in, it's very difficult for apps supporting both UIKit and ASDK to
manually manage the controllers and keep them in sync with perfect timing.

* [ASNodeController] Fix one of the #if's.
2017-05-01 10:51:59 -07:00
Adlai Holler
4d5e3ce81e Tighten Rasterization API, Undeprecate It (#82)
* Tamp down the rasterization API, and undeprecate it

* Update license header

* Update chornglorg

* Address comments
2017-05-01 08:26:37 -07:00
appleguy
03a1aa2660 [ASDisplayNode] Implement a std::atomic-based flag system for superb performance (#89)
* [ASDisplayNode] Convert isSynchronous to an Objective-C atomic BOOL.

This reduces lock contention, and should also fix a very rarely seen deadlock.

* [ASDisplayNode] Implement a std::atomic-based flag system for superb performance

Although Objective-C atomics are equally fast, or better that std::atomic when
access through method calls, for the most intense use cases it is best to avoid
method calls entirely.

In ASDisplayNode, we could benefit significantly from avoiding both method calls
(already true today) but also avoid locking the mutex, for both CPU and contention
gains.

There will still be many methods that need locking for transactional
consistency - however, there are currently dozens of accessor methods that could
avoid frequent lock / unlock cycles with use of atomics, and other usages of the
ivars directly where locking could be delayed until after early-return conditions
are checked and passed.
2017-04-29 23:10:59 -07:00
rewcraig
e18d1394e4 Fix issue with swipe to delete cell gesture. (#46)
Ensure superclass scroll view delegate methods are called when the scroll view parameter is not the current ASTableView.
2017-04-29 15:54:00 -07:00
Adlai Holler
456dc8535d Simplify Hashing Code (#86)
* Simplify hashing

* Update chingling

* Update license
2017-04-29 15:23:00 -07:00
appleguy
411817b58c [Yoga] Ensure that calculated layout is nil'd in invalidate*Layout (#87)
This is a simple additional fix to the last YOGA patch.
2017-04-29 15:06:23 -07:00
appleguy
6f82d0f059 [Yoga Beta] Improvements to the experimental support for Yoga layout. (#59)
* [Yoga Beta] Improvements to the experimental support for Yoga layout.

Yoga remains an unsupported / speculative feature, but these improvements are important for
the functionality of clients that are experimenting with it.

For example, without these changes, ASButtonNode is not able to lay out correctly. These
changes allow certain subtrees that use layout specs to coexist properly in a Yoga heirarchy.

The most significant change here is moving ASEdgeInsets into the #if YOGA gating. Although
this is technically an API change, this type was added with no known use cases and is
really only useful for flexbox layout specification. So, before usages of it are created,
it makes sense to constrain the Texture API surface until that time.

* [RTL] Bridge the UISemanticContentAttribute property for more convenient RTL support.

Although apps could handle this before by setting the view's property in didLoad, it's
useful to bridge this property for setting during off-main initialization.

This change also makes RTL fully functional / automatic for Yoga layout users.

* Remove RTL property addition and depend on PR #60 landing first.

* Fix warnings

* Add line to changelog
2017-04-27 15:43:29 -07:00
Garrett Moon
f92dd7f967 Fix documentation warning on ASCollectionLayoutState.h (#77) 2017-04-27 13:34:25 -07:00
Huy Nguyen
29d6d7df58 ASLayoutSpec to use more default implementations (#73) 2017-04-27 10:46:47 +01:00
appleguy
32c036f440 [CGPointNull] Rename globally exported C function to avoid collisions #trivial (#62)
* [CGPointNull] Rename globally exported C function to avoid collisions.

Some other frameworks also declare this. Let's try to minimize collisions
without making the name too ugly.

* Fix build errors
2017-04-26 17:21:01 -07:00
Adlai Holler
fbb14f5c7c Remove References to IGListSectionType, Now that It's Gone (#49)
* Remove references to IGListSectionType now that it’s gone

* Update changelog
2017-04-26 13:04:03 -07:00
appleguy
09ad3b79b2 [RTL] Bridge the UISemanticContentAttribute property for more convenient RTL support. (#60)
Although apps could handle this before by setting the view's property in didLoad, it's
useful to bridge this property for setting during off-main initialization.

This change also makes RTL fully functional / automatic for Yoga layout users.
2017-04-24 20:08:03 -07:00
appleguy
ce91d3cb3c [ASCollectionView] Prevent prefetching from being enabled to eliminate overhead. (#65)
Some apps explicitly enable this, which is counterproductive with ASDK.
2017-04-24 20:06:28 -07:00
Garrett Moon
8013e25524 Update license v2 (#67)
* Fixed license

* Update all licenses

* Update Dangerfile for new license

* Update already updated licenses

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…
2017-04-24 16:59:57 -07:00
Garrett Moon
2d6ccdb1d9 Fixes a potential deadlock; it's not safe to message likely super nod… (#56)
* Fixes a potential deadlock; it's not safe to message likely super nodes while holding the lock.

* I think this is what @nguyenhuy is looking for :)

* Fix up CHANGELOG.md
2017-04-24 11:25:28 -07:00
Philipp Smorygo
e45c68646a Fix __has_include check in ASLog.h #trivial (#55)
* Fix __has_include check in ASLog.h

* Fix __has_include check in ASLog.h

update changelog

* Fix __has_include check in ASLog.h

Add proper copyright in comment for ASLog.h
2017-04-22 16:50:22 +01:00
Stephen
1f69274a90 GLKit workaround #trivial (#54)
* GLKit workaround:
canClearContentsOfLayer now turned off for views with CAEAGLLayer

* Nits fixed

* Missed square bracket

* Copyright added
2017-04-22 16:47:02 +01:00
Adlai Holler
67387c0978 Build a Tips system (#19) 2017-04-19 19:51:24 -07:00
Phil Larson
dca67c3d49 Use _ASCollectionReusableView inside ASIGListSupplementaryViewSourceMethods (#40) 2017-04-19 13:26:35 -07:00