update based on Scott's comments

This commit is contained in:
Xinlei(Ryan) Pan 2020-01-29 15:47:37 -05:00
parent 347f054ed1
commit 54dc30a41a

View File

@ -353,7 +353,7 @@
// update with delegateObject
- (nonnull instancetype)initButtonSmall:(BOOL)small buttonMap:(nullable NSDictionary *)buttonMap delegateObject:(nullable DelegateObject *)delegateObject additionalData:(nullable NSDictionary *)additionalData {
NSObject<ButtonDelegateProtocol> *buttonDelegate;
NSObject<ButtonDelegateProtocol> *buttonDelegate = nil;
NSObject<MVMCoreActionDelegateProtocol> *actionDelegate = delegateObject.actionDelegate;
if ([delegateObject isKindOfClass:[MVMCoreUIDelegateObject class]]) {
buttonDelegate = ((MVMCoreUIDelegateObject *)delegateObject).buttonDelegate;
@ -362,7 +362,7 @@
}
- (nonnull instancetype)initWithPrimaryButtonMap:(nullable NSDictionary *)primaryButtonMap secondaryButtonMap:(nullable NSDictionary *)secondaryButtonMap delegateObject:(nullable DelegateObject *)delegateObject additionalData:(nullable NSDictionary *)additionalData {
NSObject<ButtonDelegateProtocol> *buttonDelegate;
NSObject<ButtonDelegateProtocol> *buttonDelegate = nil;
NSObject<MVMCoreActionDelegateProtocol> *actionDelegate = delegateObject.actionDelegate;
if ([delegateObject isKindOfClass:[MVMCoreUIDelegateObject class]]) {
buttonDelegate = ((MVMCoreUIDelegateObject *)delegateObject).buttonDelegate;
@ -371,7 +371,7 @@
}
- (void)setupWithButtonMap:(nullable NSDictionary *)buttonMap delegate:(nullable DelegateObject *)delegateObject additionalData:(nullable NSDictionary *)additionalData {
NSObject<ButtonDelegateProtocol> *buttonDelegate;
NSObject<ButtonDelegateProtocol> *buttonDelegate = nil;
NSObject<MVMCoreActionDelegateProtocol> *actionDelegate = delegateObject.actionDelegate;
if ([delegateObject isKindOfClass:[MVMCoreUIDelegateObject class]]) {
buttonDelegate = ((MVMCoreUIDelegateObject *)delegateObject).buttonDelegate;
@ -381,7 +381,7 @@
- (void)setupWithPrimaryButtonMap:(nullable NSDictionary *)primaryButtonMap secondaryButtonMap:(nullable NSDictionary *)secondaryButtonMap delegateObject:(nullable DelegateObject *)delegateObject additionalData:(nullable NSDictionary *)additionalData {
NSObject<ButtonDelegateProtocol> *buttonDelegate;
NSObject<ButtonDelegateProtocol> *buttonDelegate = nil;
NSObject<MVMCoreActionDelegateProtocol> *actionDelegate = delegateObject.actionDelegate;
if ([delegateObject isKindOfClass:[MVMCoreUIDelegateObject class]]) {
buttonDelegate = ((MVMCoreUIDelegateObject *)delegateObject).buttonDelegate;