Adds nil check on contentColor to account for future possibility of contentColor having a value in this situation, which would a different tintColor on the button.
This commit is contained in:
parent
d1d0b07c8a
commit
a3757adacd
@ -173,7 +173,16 @@
|
|||||||
|
|
||||||
if (closeButton && !self.closeButton) {
|
if (closeButton && !self.closeButton) {
|
||||||
self.closeButton = [self addCloseButtonWithAnimationDelegate:animationDelegate];
|
self.closeButton = [self addCloseButtonWithAnimationDelegate:animationDelegate];
|
||||||
[self.closeButton setTintColor:[UIColor whiteColor]];
|
//Based on the way the code is ordered now in lines 68-70, contentColor should
|
||||||
|
//still be nil when setupCloseButton is called, making a nil check superflous.
|
||||||
|
//Since this ordering could change, however, it would be best to handle a situation
|
||||||
|
//in which the contentColor is black, for example, and the closeButton
|
||||||
|
//would need to be black as well.
|
||||||
|
if (self.contentColor == nil) {
|
||||||
|
[self.closeButton setTintColor:[UIColor whiteColor]];
|
||||||
|
} else {
|
||||||
|
[self.closeButton setTintColor:self.contentColor];
|
||||||
|
}
|
||||||
} else if (!closeButton && self.closeButton) {
|
} else if (!closeButton && self.closeButton) {
|
||||||
[self.closeButton removeFromSuperview];
|
[self.closeButton removeFromSuperview];
|
||||||
self.closeButton = nil;
|
self.closeButton = nil;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user