diff --git a/AsyncDisplayKit/Details/_ASDisplayLayer.mm b/AsyncDisplayKit/Details/_ASDisplayLayer.mm index 8fe19635..4c70356f 100644 --- a/AsyncDisplayKit/Details/_ASDisplayLayer.mm +++ b/AsyncDisplayKit/Details/_ASDisplayLayer.mm @@ -101,18 +101,11 @@ #endif - (void)layoutSublayers -{ +{ + ASDisplayNodeAssertMainThread(); [super layoutSublayers]; - ASDisplayNode *node = self.asyncdisplaykit_node; - if (ASDisplayNodeThreadIsMain()) { - [node __layout]; - } else { - ASDisplayNodeFailAssert(@"not reached assertion"); - dispatch_async(dispatch_get_main_queue(), ^ { - [node __layout]; - }); - } + [self.asyncdisplaykit_node __layout]; } - (void)setNeedsDisplay diff --git a/AsyncDisplayKit/Details/_ASDisplayView.mm b/AsyncDisplayKit/Details/_ASDisplayView.mm index 8eab7fda..cef6e169 100644 --- a/AsyncDisplayKit/Details/_ASDisplayView.mm +++ b/AsyncDisplayKit/Details/_ASDisplayView.mm @@ -43,10 +43,6 @@ } #pragma mark - NSObject Overrides -- (instancetype)init -{ - return [self initWithFrame:CGRectZero]; -} - (NSString *)description { @@ -57,14 +53,6 @@ #pragma mark - UIView Overrides -- (instancetype)initWithFrame:(CGRect)frame -{ - if (!(self = [super initWithFrame:frame])) - return nil; - - return self; -} - - (void)willMoveToWindow:(UIWindow *)newWindow { BOOL visible = (newWindow != nil); @@ -192,25 +180,9 @@ - (void)setNeedsDisplay { + ASDisplayNodeAssertMainThread(); // Standard implementation does not actually get to the layer, at least for views that don't implement drawRect:. - if (ASDisplayNodeThreadIsMain()) { - [self.layer setNeedsDisplay]; - } else { - dispatch_async(dispatch_get_main_queue(), ^ { - [self.layer setNeedsDisplay]; - }); - } -} - -- (void)setNeedsLayout -{ - if (ASDisplayNodeThreadIsMain()) { - [super setNeedsLayout]; - } else { - dispatch_async(dispatch_get_main_queue(), ^ { - [super setNeedsLayout]; - }); - } + [self.layer setNeedsDisplay]; } - (UIViewContentMode)contentMode