clean up optimization docs rearrange sections in nav bar add layout api sizing Q to FAQ add corner rounding to Optimizations + check back soon tags for methods to be released in 2.0 add layoutSpecs Containers overview -> node containers Node overview -> node subclasses remove ASTextCellNode
2.0 KiB
Executable File
title, layout, permalink, prevPage, nextPage
| title | layout | permalink | prevPage | nextPage |
|---|---|---|---|---|
| Hit Test Visualization | docs | /docs/debug-tool-hit-test-visualization.html | synchronous-concurrency.html | debug-tool-pixel-scaling.html |
##Visualize ASControlNode Tappable Areas##
This debug feature adds a semi-transparent highlight overlay on any ASControlNodes containing a target:action: pair or gesture recognizer. The tappable range is defined as the ASControlNode’s frame + its .hitTestSlop UIEdgeInsets. Hit test slop is a unique feature of ASControlNode that allows it to extend its tappable range.
In the screenshot below, you can quickly see that
- The tappable area for the avatar image overlaps the username’s tappable area. In this case, the user avatar image is on top in the view hierarchy and is capturing some touches that should go to the username.
- It would probably make sense to expand the `.hitTestSlop` for the username to allow the user to more easily hit it.
- I’ve accidentally set the hitTestSlop’s UIEdgeInsets to be positive instead of negative for the photo likes count label. It’s going to be hard for a user to tap the smaller target.
##Restrictions##
A green border on the edge(s) of the highlight overlay indicates that that edge of the tapable area is restricted by one of it's superview's tapable areas. An orange border on the edge(s) of the highlight overlay indicates that that edge of the tapable area is clipped by .clipsToBounds of a parent in its hierarchy.
##Usage##
In your AppDelegate.m file,
- import `AsyncDisplayKit+Debug.h`
- add `[ASControlNode setEnableHitTestDebug:YES]` at the top of your `didFinishLaunchingWithOptions:` method
