Facebook Asynchronous Layout and Rending

来源:互联网 发布:he deserve it 编辑:程序博客网 时间:2024/05/16 06:10

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;});});}


1 0
原创粉丝点击