The simpler way to black and white the APP interface is to UIView
add a mask on it. We have defined it UKOverlayView
to realize this function
@implementation UKOverlayView
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self setupInitialUI];
}
return self;
}
- (void)setupInitialUI {
if (@available(iOS 13.0, *)) {
self.translatesAutoresizingMaskIntoConstraints = false;
self.backgroundColor = [UIColor lightGrayColor];
self.layer.compositingFilter = @"saturationBlendMode";
self.layer.zPosition = FLT_MAX;
}
}
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
return nil;
}
@end