[Translation] asyncdisplaykit

Source: Internet
Author: User

Asyncdisplaykit

Asyncdisplaykit is an iOS framework that keeps even the most complex user interfaces smooth and responsive. it was originally built to make Facebook's paper possible, and goes hand-in-hand with Pop's physics-based animations-but it's just as powerful with uikit dynamics and conventional app designs.

Asyncdisplaykit (asynchronous Graphic Display) is an open-source IOS framework that can improve and smooth complex user interaction issues. Initially, it was developed to optimize Facebook's paper applications, as well as pop-based physical engine animations-of course, it is as efficient and well-designed as the uikit dynamics framework.

Quick Start

Asdk is available on cocoapods. Add the following to your podfile:

You can install asdk through cocoapods and add the following files to podfile:

pod ‘AsyncDisplayKit‘

Import the framework header, or create an objective-C bridging header if you're using SWIFT:

Import the header file of the framework or create the objective-C bridging header. If you are using swift development:

#import <AsyncDisplayKit/AsyncDisplayKit.h>

Asyncdisplaykit nodes are a thread-safe alternative action layer over uiviews and calayers:

The asyncdisplaykit node is a thread-safe abstract layer that covers the uiview and calayer

You can construct entire node hierarchies in parallel, or instantiate and size a single node on a background thread-for example, you cocould do something like this in a uiviewcontroller:

You can encapsulate a Node object or instantiate a Node object in a child thread. For example, you can perform the following operations in uiviewcontroller:

dispatch_async(_backgroundQueue, ^{  ASTextNode *node = [[ASTextNode alloc] init];  node.attributedString = [[NSAttributedString alloc] initWithString:@"hello!"                                                          attributes:nil];  [node measure:CGSizeMake(screenWidth, FLT_MAX)];  node.frame = (CGRect){ CGPointZero, node.calculatedSize };  // self.view isn‘t a node, so we can only use it on the main thread  dispatch_sync(dispatch_get_main_queue(), ^{    [self.view addSubview:node.view];  });});

You can useASImageNodeAndASTextNodeAs drop-in replacements for uiimageview and uitextview, or create your own nodes to implement node hierarchies or custom drawing.ASTableViewIs a node-aware uitableview subclass that can asynchronously preload cell nodes without blocking the main thread.

You can use the inheritance classes of asimagenode and astextnode to replace uiimageview and uitextview, or create your own node to implement your own painting method, astableview is a subclass of uitableview of a custom node. It can load cell nodes asynchronously without blocking the main thread.

 

Learn more

  • Read the Getting Started Guide
  • Get the sample projects
  • Browse the API reference
  • Watch the nslondon talk

 

[Translation] asyncdisplaykit

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.