首页 > 代码库 > Facebook Asynchronous Layout and Rending

Facebook Asynchronous Layout and Rending

Facebook Asynchronous Layout and Rending

by 伍雪颖

dispatch_async(backgroundQueue, ^{
	storyNode = [[FBStoryNode alloc] initWithStory:story];
	[storyNode layoutWithin:CGSizeMake(320,FLT_MAX)];
});

- (void)display {
	dispatch_async(backgroundQueue, ^{
		CGContextRef ctx = newContextOfSize(self.bounds.size);
		[self.node drawInContext:ctx];
		dispatch_async(main, ^{
			self.contents = ctx;
		});
	});
}


Facebook Asynchronous Layout and Rending