252 Commits

Author SHA1 Message Date
Nadine Salter
f20e29ea46 1.1 beta(tm). 2014-12-15 18:03:07 -08:00
Nadine Salter
bf01b07443 Merge pull request #143 from facebook/placeholder-api
Node placeholder API
2014-12-15 17:31:11 -08:00
Ryan Nystrom
d27c8859c7 Node placeholder API
ASDisplayNodes now have an overidable method -placeholderImage that lets you provide a custom UIImage to display while a node is displaying asyncronously. The default implementation of this method returns nil and thus does nothing. A provided example project also demonstrates using the placeholder API.
2014-12-15 17:23:52 -08:00
Li Tan
8b303710b6 fix unncessary change in editing 2014-12-15 15:57:11 -08:00
Li Tan
f7f5988fcd Support editing in table view and collection view 2014-12-15 13:19:10 -08:00
Nadine Salter
5cb261bbd1 Merge pull request #153 from jpasqualini/master
Setting a node's background color shouldn't require calling setNeedsDisplay explicitly
2014-12-12 16:02:38 -08:00
Justin Pasqualini
e098e13884 Setting a node's background color shouldn't require calling setNeedsDisplay explicitly 2014-12-12 15:47:31 -08:00
Nadine Salter
d8c1d71f24 Merge pull request #144 from facebook/issue-107
Support UIViewContentModeCenter with ASImageNode
2014-12-09 11:52:47 -08:00
Nadine Salter
e310b75afd Merge pull request #147 from yufenglv/master
fix the crash when calling rebuildData (#138)
2014-12-07 15:21:09 -08:00
越凡
263db6f46c When doing refresh, we should cancel perform requests previously registered with performSelector:withObject:afterDelay: first, or it will do the sizeNextBlock twice with the same indexPath and then it will crash. 2014-12-07 14:26:09 +08:00
Nadine Salter
38cc2f6896 Fix header visibility. 2014-12-05 16:16:54 -08:00
Ryan Nystrom
647a9409d6 Support UIViewContentModeCenter with ASImageNode 2014-12-05 15:25:55 -08:00
Nadine Salter
6cdff0e66d Merge pull request #141 from facebook/proxy-teardown
_ASTableViewProxy & _ASCollectionViewProxy fixes.
2014-12-05 15:23:59 -08:00
Nadine Salter
764650fb94 _ASTableViewProxy & _ASCollectionViewProxy fixes.
These weren't correctly handling teardown:  nilling the `asyncDelegate`
created a new selector-forwarding NSProxy that crashed and burned
because there was nowhere to forward to.  Nil everything correctly.

Tentatively fixes #121.
2014-12-04 16:29:57 -08:00
Nadine Salter
16445cfd5d Typecast objc_msgSend call in tests. 2014-12-04 13:11:43 -08:00
Nadine Salter
68a5b32b79 Merge pull request #140 from facebook/manual-display-part-deux
Update manual display logic
2014-12-04 12:57:03 -08:00
Nadine Salter
eb600b955a Merge pull request #139 from facebook/imagedownloader-ios7
ASBasicImageDownloader iOS 7 support
2014-12-04 12:56:06 -08:00
Ryan Nystrom
36cbea4f8f Update manual display logic
Postpone manual display until a future release when it can be called on any thread. Provide the current node manual display logic as a category on ASDisplayNode only available for ASRangeController. Deprecate -displayImmediately.
2014-12-04 11:55:17 -08:00
Ryan Nystrom
c645935631 ASBasicImageDownloader iOS 7 support
On iOS 7, NSURLSessionTask is actually a __NSCFURLSessionTask (private class) and our NSURLSessionTask category to add the associated object asyncdisplaykit_metadata was crashing on iOS 7 stating that there was no method. This commit changes the category to extend NSURLRequest as well as change NSURLSessionTask to NSURLSessionDownloadTask.
2014-12-04 11:25:36 -08:00
Nadine Salter
8bb78ff90c [docs] Update front matter.
Update the README and asyncdisplaykit.org front page to mention ASDK
1.1's new additions -- ASMultiplexImageNode, ASNetworkImageNode, and
ASCollectionView.
2014-12-03 18:17:26 -08:00
tanliboy
6c0ffdf2e1 Merge pull request #135 from facebook/basic-init
Make ASNetworkImageNode Just Work.
2014-12-03 17:40:27 -08:00
Nadine Salter
93ce2b38a2 Make ASNetworkImageNode Just Work.
Use ASBasicImageDownloader by default -- you can now do...

  ASNetworkImageNode *imageNode = [[ASNetworkImageNode alloc] init];
  imageNode.URL = [NSURL URLWithString:@"..."];
  [self.view addSubview:imageNode.view];

...and it'll do the right thing.
2014-12-03 17:31:56 -08:00
Nadine Salter
cfe1fc6858 Merge pull request #130 from facebook/range-driver
Working-range-driven image loading.
2014-12-03 16:16:43 -08:00
Nadine Salter
79e65342b1 Working-range-driven image loading.
Add a `usleep(1.0 * USEC_PER_SEC)` delay to ASBasicImageDownloader and
slowly scroll through the Kittens sample project.  Without this patch,
you'll see that images only start downloading after their purple
placeholders appear onscreen.  With it, images can download and render
before you scroll them onscreen, thanks to the working range.
2014-12-02 19:23:23 -08:00
Nadine Salter
db085c49be Support realistic display delays (for debugging).
ASDISPLAYNODE_DELAY_DISPLAY unconditionally delays *all* attempts to
execute display blocks, even those that have been cancelled.  Fix that.

The DELAY_DISPLAY debugging tool is intended to simulate the effect of
expensive draw calls -- it lets you test your app's behaviour under
conditions potentially even worse than an iPhone 4.  Unfortunately, the
current simulation is unusably incorrect, as can be demonstrated by
repeatedly scrolling up and down in the Kittens example project.

ASRangeController enqueues asynchronous display of ASTableView cell
nodes when they enter the working range, and suspends their display when
they exit.  On a slow device, this performs as desired, limiting
expensive display computation to the space of the working range.  In
the DELAY_DISPLAY simulation, the suspended displays are as expensive as
the executed ones, so ASRangeController becomes unusably slow.
2014-12-02 19:04:49 -08:00
Nadine Salter
4cd110e630 Merge pull request #128 from facebook/cleanup
Miscellaneous cleanup.
2014-12-02 19:04:20 -08:00
Nadine Salter
1103f82a5c .preventOrCancelDisplay -> .displaySuspended.
Rename the ASDisplayNode property to match its _ASDisplayLayer
counterpart -- `displaySuspended` is more succinct and is a more
plausible name for a Cocoa BOOL property.
2014-12-02 18:06:11 -08:00
Nadine Salter
51f3073c33 ASDisplayNode.inWindow -> .inHierarchy.
This is a remnant from before `willAppear` and `didDisappear` were
renamed to better reflect their hierarchy-change status (being added to
the hierarchy != being visible).  May be useful for turians.
2014-12-02 18:06:11 -08:00
Nadine Salter
a30c087616 Clean up ASDisplayNode internal flags.
* Reorganise and rename `_flags` for clarity and consistency.
* Remove ambiguity between `implementsDisplay` and `hasClassDisplay`.
* Delete useless `hasWillDisplayAsyncLayer` check -- make it a simple
  subclass override point, as with `didDisplayAsyncLayer:`.
* Minor comment cleanup.
2014-12-02 18:06:11 -08:00
Nadine Salter
a53bc08eaf Merge pull request #127 from facebook/manual-display
Add -[ASDisplayNode display].
2014-12-02 17:49:55 -08:00
Ryan Nystrom
531be46dfd Cleaning up manual display per @secretiverhyme 2014-12-02 16:53:17 -08:00
Ryan Nystrom
8b0dbf7288 Manually display nodes
Added a sample project that will demonstrate how to manually display nodes. Removed the UIWindow hack that coupled display of nodes with Core Animation transactions.
2014-12-02 09:34:24 -08:00
Nadine Salter
5fc5adbb65 Merge pull request #117 from facebook/image-downloader
Simple, drop-in image downloader.
2014-12-01 14:49:44 -08:00
Nadine Salter
ab46377af2 Merge pull request #118 from nguyenhuy/custom_working_range_calculation
Support custom working-range logic for ASRangeController
2014-12-01 14:40:14 -08:00
Huy Nguyen
230520fe7e Support custom working-range logic. 2014-11-25 12:31:20 +02:00
Nadine Salter
8e2a207373 [travis] Only run tests on master; ./build.sh.
Don't consider the build broken if a feature branch is broken.

Move the actual build command to a separate script -- easier to read,
easier to maintain, and easier to run by hand.
2014-11-21 18:46:22 -08:00
Nadine Salter
8ecebcfe70 Convert Kittens sample project to ASNetworkImageNode.
Working-range-driven image loading.

(Note that ASNetworkImageNode and ASMultiplexImageNode haven't yet been
updated to work with the new `-reclaimMemory`-based working range
system, so this doesn't quite behave correctly yet.)
2014-11-21 18:40:18 -08:00
Nadine Salter
3c690bf9e5 ASBasicImageDownloader.
This is a simplistic, NSURLSession-based downloader object that
implements ASImageDownloaderProtocol and can be used with
ASMultiplexImageNode and ASNetworkImageNode.

(Closes #115.  NSURLSession should suffice for most usecases, and this
code should provide a good jumping-off point for a more-complex
implementation.)
2014-11-21 18:40:18 -08:00
Nadine Salter
18d52949e6 Missed a spot! 2014-11-21 17:48:29 -08:00
Nadine Salter
03156dceb6 ASNetworkImageNode ARC fixes. 2014-11-21 17:05:24 -08:00
Nadine Salter
964d109be6 ASImageNodeRoundBorderModificationBlock(). 2014-11-20 11:38:47 -08:00
Nadine Salter
1e929c3ead [travis] Drop iOS 8.0 tests. 2014-11-20 11:38:36 -08:00
Nadine Salter
5470b4cb74 [travis] Update build scripts for Xcode 6.1. 2014-11-20 11:34:07 -08:00
Nadine Salter
460b3582c9 Update umbrella header. 2014-11-18 18:21:41 -08:00
Nadine Salter
1eda1834e6 ASNetworkImageNode.
Initial open-source release of ASNetworkImageNode, a simple counterpart
to ASMultiplexImageNode.
2014-11-18 18:07:31 -08:00
Nadine Salter
38f8e63b01 Support fractional tuning parameters (fixes #112). 2014-11-18 14:15:01 -08:00
Nadine Salter
ee3aec42a2 Tidy ASCollectionView sample project. 2014-11-18 14:14:28 -08:00
appleguy
3f7dc75bb1 Merge pull request #101 from nguyenhuy/collection_view
Add ASCollectionView
2014-11-17 19:03:59 -08:00
Nadine Salter
f25bb07c6b Tweak ASMultiplexImageNode example assets. 2014-11-17 17:31:38 -08:00
Nadine Salter
18cb359ad0 ASMultiplexImageNode example project. 2014-11-17 17:25:46 -08:00