Commit Graph

757 Commits

Author SHA1 Message Date
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
Adlai Holler
5b80a641af Improve Handling of Rasterized Node Interface & Hierarchy States (#2731)
* Improve handling of rasterize node interface states and testing

* Fix harder

* Finish fixes and move rasterization flag into beta header

* Re-enable rasterization in ASDKgram

* Re-enable working test

* Only do it in debug
2016-12-08 09:52:21 -08:00
Adlai Holler
1997073802 Address Misc Warnings (#2698)
* Address compiler warnings

* Typo
2016-12-02 14:04:05 -08:00
Adlai Holler
40a8769217 Filter out extra items when querying collection view layout (#2693) 2016-12-02 08:48:46 -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
Garrett Moon
ba2268ac99 2611 rename fetch data (#2689)
* Replace fetch data with preload terminology
- Deprecate `-fetchData` and `-clearFetchedData` in favor of `-preload` and `-clearPreloadedData`
- Move `-setNeedsPreload`, `-recursivelyPreload` and `-recursivelyClearPreloadedData` to ASDisplayNode+FrameworkPrivate.h
- Update internal implementation, comments and tests

* Folllow up on #2642:
- Remove -preload and -clearPreloadedData in favor of -didEnterPreloadState and -didExitPreloadState.
- -didEnterPreloadState and -didExitPreloadState call the deprecated -fetchData and -clearFetchedData methods if they are overriden.

* Missed one in a test

* Get rid of behavior change for now.

* Revert more behavior changes, fix tests.

* Don't need these anymore.
2016-12-01 13:41:22 -08:00
Adlai Holler
df497b82c2 Improve Batch Fetching Call Pattern to Reduce Fetch Calls (#2675)
* Test & tweak batch fetching implementation

* Tighten the test

* Stop batch fetching at the end of range controller pass

* Clean up the test

* Still check for batch fetching after each frame when scrolling

* Ensure batch fetching happens for empty collection/table
2016-11-29 13:40:03 -08:00
Garrett Moon
04dc582a7a Rename didUpdateCurrentRangeMode to preserveCurrentRangeMode 2016-11-27 16:05:31 -08:00
Garrett Moon
62f378a9fd This patch enables memory warning support on ASRangeController by default
It also fixes a couple subtle bugs:
1. If a range controller update was in flight and you were manually setting the range
mode, you could actually clear out the range mode by calling updateCurrentRangeWithMode:
This is fixed by setting _didUpdateCurrentRange = YES if _needsRangeUpdate is YES.
2. Calling setNeedsUpdate after calling updateCurrentRangeWithMode: can cause the
current range mode to get cleared out. This is because updateCurrentRangeWithMode:
will not set _didUpdateCurrentRange if _currentRangeMode == rangeMode.
2016-11-27 15:42:07 -08:00
Adlai Holler
b689a59b45 Mark isCancelled block as noescape to improve the Swift import 2016-11-27 10:31:35 -08:00
rmalik
15f8dc572a - Fix assignment of alternativeRepresentationProvider to be the singleton
instance of ASPINRemoteImageDownloader.
- Revert "Revert "Expose internal singleton method as a class method vs instance method.""
- Fix API bug in ASCollectionNode+Beta
2016-11-23 15:51:40 -08:00
Scott Goodson
0c65d21f8d Revert "Expose internal singleton method as a class method vs instance method."
Causing crash: +[ASPINRemoteImageDownloader alternateRepresentationWithData:options:]: unrecognized selector sent to class 0x198e3d8

This reverts commit 91c06272b1.
2016-11-22 21:59:58 -08:00
rmalik
91c06272b1 Expose internal singleton method as a class method vs instance method.
Currently setting an NSURLSessionConfiguration through ASPINRemoteImageManager
will crash.
2016-11-22 18:04:19 -08:00
Adlai Holler
71872a298e Merge pull request #2223 from facebook/AHNaturalDealloc
[ASDisplayNode] Let Nodes Deallocate Naturally, Deallocate UIKit Components in Run Loop
2016-11-21 01:20:47 +09:00
Adlai Holler
e923943e8c Use CACurrentMediaTime instead of CFAbsoluteTime 2016-11-21 00:54:07 +09: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
appleguy
3d524dfe3a Merge pull request #2635 from garrettmoon/moveASCollectionViewLayoutInspector
[ASCollectionView] Move ASCollectionViewLayoutInspector to its own file
2016-11-19 16:16:19 -08:00
Garrett Moon
0253ae1291 Do not assert when scrollableDirections is called in base class. 2016-11-19 15:43:47 -08:00
Garrett Moon
88d0dff09c [ASCollectionView] Move ASCollectionViewLayoutInspector to its own file 2016-11-19 15:14:03 -08:00
Michael Schneider
2cd49642b9 Address comments from @appleguy 2016-11-19 06:43:46 -08:00
Michael Schneider
a71a1d8519 Address comments 2016-11-19 06:43:46 -08:00
Michael Schneider
5d84f21fda Add sizeThatFits: to _ASDisplayView 2016-11-19 06:43:46 -08:00
Michael Schneider
0eb882bae5 Some more changes 2016-11-19 06:43:46 -08:00
Michael Schneider
0f8eac4757 Some other commit 2016-11-19 06:43:45 -08:00
Adlai Holler
4a48ba8be2 Improve our event logging greatly 2016-11-17 12:04:30 +09:00
Craig Howarth
e8688d645a [ASCollectionView] Allow Decoration Views 2016-11-16 17:16:15 -05:00
rmalik
7769883dc8 Add method to specify the default NSURLSessionConfiguration for
ASPINRemoteImageDownloader. This will allow callers to supply their own custom
logic whether that is background downloads, custom http headers, cookie
storage, etc.
2016-11-14 16:19:48 -08:00
Adlai Holler
e2e32870ed Reduce Flashing & Optimize ASTableNode/ASCollectionNode Data Loading (#2541)
* Optimize data controller loading by combining section updates with first set of item updates

* Update call pattern test

* Add some explanation about the approach
2016-11-14 14:30:41 +09:00
Adlai Holler
6bbc9a3cb0 Add a macro (default 0) to control event backtrace recording (#2584) 2016-11-08 21:50:59 -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
a1156e108f Reduce memory consumption caused by event tracing (#2570) 2016-11-08 18:06:31 -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
Garrett Moon
cc00626642 Fix Carthage build (#2567) 2016-11-07 15:54:23 -08:00
Adlai Holler
a6e2f8e5ab Finish Porting indexPath-Oriented Methods to ASTableNode/ASCollectionNode (#2527)
* Finish porting over the indexPath-oriented properties from table/collection view to node

* Make indexPathForSelectedRow a property
2016-11-01 15:03:46 -07: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
george-gw
d83f058f82 Deprecate indexPath-based Methods on ASTableView/ASCollectionView (#2498)
* Deprecated indexPath methods in ASTableView and ASTableNode and added several indexPath methods to ASTableNode and ASCollectionNode.

* Fixed incorrect doc.
Removed unnecessary __kindof.
2016-10-29 09:50:11 -07:00
Adlai Holler
8add4619cf Reduce Traffic to Table/Collection View When Updating (#2496)
* Improve the call pattern when loading table/collection data

* When deleting sections, no need to delete rows first

* Clean up a couple things
2016-10-28 09:42:45 -07:00
george-gw
54cda5fdbb [ASCellNode] Added indexPath property. (#2468)
* [ASCellNode] Added indexPath property.

* [ASCellNode] Cached the type of scrollView we're using in the node, and placed that logic in setScrollView.

* [ASCellNode] Removed table and collection view from indexPath, since they return the index paths from the view-space.

* Changed the logic for getting indexPath so that it works even when the cell is not displayed.

* [VerticalWithinHorizontalScrolling] Explicitally synthesized indexPath property.
2016-10-27 16:56:00 -07:00
Adlai Holler
627d146a5a Add scrollToItem: Method to Node, Handle Section Index Paths (#2462)
* Add scrollToItem: method to node, handle section index paths

* Update ASPagerNode.mm to use the node version

* Add some docs
2016-10-26 12:48:25 -07:00
Michael Schneider
6d5bd6e969 Cleanup calculateLayoutThatFits: (#2480) 2016-10-26 11:26:57 -07:00
Hannah Troisi
2834ba3490 [ASPagerNode] Fix ASPagerNodeProxy to use collectionNode (#2475)
* Fix ASProxyDelegate to use collectionNode

* fix constrainedSize...issue
2016-10-24 16:10:56 -07:00
Garrett Moon
86a5aece9c Caching scrollable directions is not safe (#2474) 2016-10-24 14:05:03 -07:00
Adlai Holler
d0421195eb Make flow layout inspector call the new constrainedSize method (#2444) 2016-10-20 14:32:01 -07:00
Adlai Holler
dbe3b1bd71 Remove block copying (#2438) 2016-10-20 12:53:25 -07:00
Hannah Troisi
84d1a637d7 [2.0] add helpful deprecation messages (#2437)
[2.0] add helpful deprecation messages
2016-10-19 14:48:06 -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
d32bf3f297 Conditionally import signpost header to fix Xcode 7 build (#2432) 2016-10-19 10:45:58 -07:00
Garrett Moon
093653b507 Upgrades to the latest PINRemoteImage (#2414) 2016-10-18 08:35:25 -07:00
Hannah Troisi
902bb0999d remove miscellaneous true values (#2391)
[Code Cleanup] Replace `true` values with `YES`
2016-10-15 18:28:46 -07:00