16 Commits

Author SHA1 Message Date
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
Hannah Troisi
9719357901 [ASLayoutElement] Move ASDisplayNode's .name property to ASLayoutElement (renamed to .debugName) (#2395)
* Move ASDisplay .name property to ASLayoutElement

* keep ASDisplayNode.name deprecated

* address @appleguy's comments
2016-10-20 17:27:31 -07:00
Adlai Holler
ff37535140 [Testing] Migrate Unit Tests to ARC (#2156)
* Migrate ASDisplayNodeTests to ARC

* Migrate ASDisplayNodeAppearanceTests to ARC

* Migrate ASDisplayLayerTests to ARC

* Migrate ASMultiplexImageNodeTests to ARC

* Address Garrett's feedback
2016-08-27 15:09:59 -07:00
John Engelhart
ea64d7d09b Pr/fix unit tests memory leaks (#1795)
* Fix some concurrency problems detected by Xcode 8's new Thread Sanitizer.

Some of these changes are arguably just to silence the warnings from Thread Sanitizer.

* Fix several memory leaks in the unit tests.

A number of the unit test source files are compield with `-fno-objc-arc`.  This was clearly overlooked when writing several of the unit tests.

Fixed by (mostly) switching to use of `-autorelease` for the problem code.

NOTE: This commit doesn't fix all the memory leaks found.  There's still at least one leak in `-[ASDisplayNodeTests testSetNeedsDataFetchImmediateState]`, and several leaks in `ASBasicImageDownloader.mm`.  I wasn't able to find a trivial cause to these, unfortunately.
2016-06-22 16:56:53 -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
Scott Goodson
b8602d1073 Fix ASBasicImageDownloader tests - prevent use of init / new instead of +sharedImageDownloader. 2015-12-20 15:42:57 -08:00
Huy Nguyen
53a3b76d6d Add read-only names to UIView and CALayer
- Backed by name of the underlying ASDisplayNode.
- Remove goofy usages of `setValue:forKey:` in ASDisplayNodeTests and ASDisplayNodeAppearanceTests.
2015-10-26 07:44:05 +02:00
Huy Nguyen
fd0b3aaf52 Revert "Revert "Make ASDisplayNode.name Thread Safe""
This reverts commit 906d7c759b471eda67b95574199b6f91d46b6782.
2015-10-26 06:29:01 +02:00
appleguy
906d7c759b Revert "Make ASDisplayNode.name Thread Safe" 2015-10-25 19:40:47 -07:00
Adlai Holler
99113388a8 Make tests use CALayer.asyncdisplaykit_node.name rather than CALayer.asyncdisplaykit_name as needed 2015-10-24 10:58:09 -07:00
Nadine Salter
fab6f623a8 Deprecate -initWith{View,Layer}Class:.
These have been superseded by -[ASDisplayNode initWithViewBlock:] and
-[ASDisplayNode initWithLayerBlock:], respectively -- the new API allows
for custom initialisers, but does not support asynchronous display.

The old initialisers are still available in ASDisplayNodeInternal.h, for
internal subclasses and daring adventurers.
2015-01-24 11:52:27 -08:00
Nadine Salter
16445cfd5d Typecast objc_msgSend call in tests. 2014-12-04 13:11:43 -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
7dd94a6102 Merge in downstream changes.
Introduce `ASTableView`, a UITableView subclass that uses `ASCellNode`
instead of UITableViewCell.  Add working range support via
`ASRangeController`, which observes the visible range, maintains a
working range, and handles most ASDK machinery.  ASRangeController is
loosely-enough coupled that it should be easily adapted to
UICollectionView if that's desired in the future.

Notable considerations in the ASRangeController architecture:

* There's no sense rewriting UITableView -- the real win comes from
  using nodes instead of UITableViewCells (easily parallelisable
  computation, large number of cells vs. few table views, etc.).  So,
  use a UITableView with empty cells, using UITableViewCell's
  contentView as a host for arbitrary node hierarchies.

* Instead of lazy-loading cells the instant they're needed by
  UITableView, load them in advance.  Preload a substantial number of
  nodes in the direction of scroll, as well as a small buffer in the
  other direction.

* Maintain compatibility with UITableView's API, with one primary change
  -- consumer code yields configured ASCellNodes, not UITableViewCells.

* Don't use -tableView:heightForRowAtIndexPath:.  Nodes already compute
  their preferred sizes and cache results for use at layout-time, so
  ASTableView uses their calculatedSizes directly.

* Corollary:  ASTableView is only aware of nodes that have been sized.
  This means that, if a cell appears onscreen, it has layout data and
  can display a "realistic placeholder", e.g. by making its subnodes'
  background colour grey.

Other improvements:

* Remove dead references and update headers (fixes #7, #20).

* Rename `-[ASDisplayNode sizeToFit:]` to `-measure:` and fix
  `constrainedSizeForCalulatedSize` typo (fixes #15).

* Rename `-willAppear` and `-didDisappear` to `-willEnterHierarchy` and
  `-didExitHierarchy`.  Remove `-willDisappear` -- it was redundant, and
  there was no counterpart `-didAppear`.

* Rename `viewLoaded` to `nodeLoaded`.
2014-09-22 14:33:39 -07:00
Andrew Toulouse
a35c109a08 Unify boolean flag naming confention, getter spacing, and property attribute naming
Summary:
* Fixes #3
* Ordering: atomicity, then [optional] readonly, then value semantics (retain/copy/assign)
* Removed redundant `readwrite`
* No spaces between "getter = name" ("getter=name" instead)
* Property method overrides renamed as well
* self.isBlah, while technically not entirely correct, still resolves to [self blah], so left alone (@kimon had advice on this sort of naming issue last summer), and largely inconsequential

Test Plan:
* Compile and run
2014-07-17 13:18:47 -07:00
Nadine Salter
15565873c9 Initial commit. 2014-06-26 22:32:55 -07:00