From 9b8011bd95bd95f6fca6a0afa78965fbf645a062 Mon Sep 17 00:00:00 2001 From: Amir Shavit Date: Sat, 6 Aug 2016 17:43:58 +0300 Subject: [PATCH] #81: PopoverController Init: Create and configure theme object and inject it to static var (#82) --- WYPopoverController/WYPopoverController.m | 54 ++++++++++++----------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/WYPopoverController/WYPopoverController.m b/WYPopoverController/WYPopoverController.m index 1595f236..0fb4c40c 100644 --- a/WYPopoverController/WYPopoverController.m +++ b/WYPopoverController/WYPopoverController.m @@ -1529,32 +1529,34 @@ - (id)init { themeIsUpdating = YES; WYPopoverBackgroundView *appearance = [WYPopoverBackgroundView appearance]; - _theme.usesRoundedArrow = appearance.usesRoundedArrow; - _theme.dimsBackgroundViewsTintColor = appearance.dimsBackgroundViewsTintColor; - _theme.tintColor = appearance.tintColor; - _theme.outerStrokeColor = appearance.outerStrokeColor; - _theme.innerStrokeColor = appearance.innerStrokeColor; - _theme.fillTopColor = appearance.fillTopColor; - _theme.fillBottomColor = appearance.fillBottomColor; - _theme.glossShadowColor = appearance.glossShadowColor; - _theme.glossShadowOffset = appearance.glossShadowOffset; - _theme.glossShadowBlurRadius = appearance.glossShadowBlurRadius; - _theme.borderWidth = appearance.borderWidth; - _theme.arrowBase = appearance.arrowBase; - _theme.arrowHeight = appearance.arrowHeight; - _theme.outerShadowColor = appearance.outerShadowColor; - _theme.outerShadowBlurRadius = appearance.outerShadowBlurRadius; - _theme.outerShadowOffset = appearance.outerShadowOffset; - _theme.outerCornerRadius = appearance.outerCornerRadius; - _theme.minOuterCornerRadius = appearance.minOuterCornerRadius; - _theme.innerShadowColor = appearance.innerShadowColor; - _theme.innerShadowBlurRadius = appearance.innerShadowBlurRadius; - _theme.innerShadowOffset = appearance.innerShadowOffset; - _theme.innerCornerRadius = appearance.innerCornerRadius; - _theme.viewContentInsets = appearance.viewContentInsets; - _theme.overlayColor = appearance.overlayColor; - _theme.preferredAlpha = appearance.preferredAlpha; - + + WYPopoverTheme* theme = [WYPopoverTheme theme]; + theme.usesRoundedArrow = appearance.usesRoundedArrow; + theme.dimsBackgroundViewsTintColor = appearance.dimsBackgroundViewsTintColor; + theme.tintColor = appearance.tintColor; + theme.outerStrokeColor = appearance.outerStrokeColor; + theme.innerStrokeColor = appearance.innerStrokeColor; + theme.fillTopColor = appearance.fillTopColor; + theme.fillBottomColor = appearance.fillBottomColor; + theme.glossShadowColor = appearance.glossShadowColor; + theme.glossShadowOffset = appearance.glossShadowOffset; + theme.glossShadowBlurRadius = appearance.glossShadowBlurRadius; + theme.borderWidth = appearance.borderWidth; + theme.arrowBase = appearance.arrowBase; + theme.arrowHeight = appearance.arrowHeight; + theme.outerShadowColor = appearance.outerShadowColor; + theme.outerShadowBlurRadius = appearance.outerShadowBlurRadius; + theme.outerShadowOffset = appearance.outerShadowOffset; + theme.outerCornerRadius = appearance.outerCornerRadius; + theme.minOuterCornerRadius = appearance.minOuterCornerRadius; + theme.innerShadowColor = appearance.innerShadowColor; + theme.innerShadowBlurRadius = appearance.innerShadowBlurRadius; + theme.innerShadowOffset = appearance.innerShadowOffset; + theme.innerCornerRadius = appearance.innerCornerRadius; + theme.viewContentInsets = appearance.viewContentInsets; + theme.overlayColor = appearance.overlayColor; + theme.preferredAlpha = appearance.preferredAlpha; + _theme = theme; themeIsUpdating = NO; themeUpdatesEnabled = YES;