As of 2021, instead of applying a CIFilters and increasing your APP size by at least 60MB for the blur effect you just use NSVisualEffectView
in exchange for your NSView
. Choose the reference to blur onto and set the material you think it posses for, so an appropriate color or window background is chosen the blurring will be based on.
NSVisualEffectView *viewWithFX = [[NSVisualEffectView alloc] initWithFrame:NSMakeRect(0, 0, frameRect.size.width, 100)];
viewWithFX.autoresizingMask = NSViewWidthSizable | NSViewMinXMargin | NSViewMaxXMargin;
viewWithFX.translatesAutoresizingMaskIntoConstraints = YES;
viewWithFX.material = NSVisualEffectMaterialSidebar; // or NSVisualEffectMaterialMenu, or ..
viewWithFX.blendingMode = NSVisualEffectBlendingModeBehindWindow; //NSVisualEffectBlendingModeWithinWindow
[viewWithFX addSubview:<#subviews-will-not-have-fx-applied#>];
[self.view addSubview:viewWithFx];
This has the advantage that you don't need layers and it's faster than CIFilters.
PS: this will increase your App size by around 8..12MB.