From ba199eade59397854568ffe74fe06b8e6518fdb9 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Tue, 16 Apr 2019 07:23:07 -0700 Subject: [PATCH] Fabric: Marking RCTViewComponentView's methods from RCTComponentViewProtocol as `NS_REQUIRES_SUPER` Summary: If some class or category override/implement one of those methods, it implies that subclasses must call super for them. `NS_REQUIRES_SUPER` allows to enforce this constraint. Reviewed By: JoshuaGross Differential Revision: D14896804 fbshipit-source-id: a481f16e1f7ab901d70deb6486f2ca1cf19dd8d7 --- .../ComponentViews/View/RCTViewComponentView.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h b/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h index a289ed2e8..9cd1cbf3a 100644 --- a/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h +++ b/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.h @@ -68,6 +68,17 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, assign) UIEdgeInsets hitTestEdgeInsets; +/** + * Enforcing `call super` semantic for overridden methods from `RCTComponentViewProtocol`. + */ +- (void)updateProps:(facebook::react::SharedProps)props + oldProps:(facebook::react::SharedProps)oldProps NS_REQUIRES_SUPER; +- (void)updateEventEmitter:(facebook::react::SharedEventEmitter)eventEmitter NS_REQUIRES_SUPER; +- (void)updateLayoutMetrics:(facebook::react::LayoutMetrics)layoutMetrics + oldLayoutMetrics:(facebook::react::LayoutMetrics)oldLayoutMetrics NS_REQUIRES_SUPER; +- (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask NS_REQUIRES_SUPER; +- (void)prepareForRecycle NS_REQUIRES_SUPER; + @end NS_ASSUME_NONNULL_END