To get the filter in night mode, you need to reduce the effect of blue light (sunlight contains blue light and does not allow us to stay awake and warn).
The easiest way to remove blue light from your entire application is using a Content Filter in your views, in my case I use a sepia tone.
Select "View" and go to the "View Inspector"

In Content Filters, click the “+” icon and add and scroll to “Color Effect” / “Sepia Tones”

You can adjust the sepia tone or select different color filters to try to achieve the desired effect, but remember that the main goal is to remove the blue light (a sufficiently intense sepia tone with an intensity of 1).

If you want to create a filter programmatically:
#import "ViewController.h" #import <CoreImage/CIFilter.h> @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; CIFilter * sepiaTone = [CIFilter filterWithName:@"CISepiaTone" keysAndValues:@"inputIntensity", @1.0, nil]; self.view.contentFilters = [NSArray arrayWithObject:sepiaTone]; }
Apple Reference: Link to Basic Image Filters
Note. Some applications have added a red tint to all application views, but you may encounter some user interaction issues.
source share