Removed comment and used ternary operator based on code review

This commit is contained in:
Robinson, Blake 2019-09-05 10:28:50 -04:00
parent a3757adacd
commit 5adce50053

View File

@ -173,16 +173,7 @@
if (closeButton && !self.closeButton) {
self.closeButton = [self addCloseButtonWithAnimationDelegate:animationDelegate];
//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];
}
[self.closeButton setTintColor:self.contentColor ?:[UIColor whiteColor]];
} else if (!closeButton && self.closeButton) {
[self.closeButton removeFromSuperview];
self.closeButton = nil;