How to Convert UIImage to CIImage and vice versa

CIImage *ciImage = [UIImage imageNamed:@”test.png”].CIImage; UIImage *uiImage = [[UIImage alloc] initWithCIImage:ciImage]; To fix the case where myUIImage.CIImage returns nil like [UIImageView image], you can instead do [CIImage imageWithCGImage:myUIImage.CGImage] – Dylan Hand Swift version: let ciImage = UIImage(named: “test.png”)!.ciImage let uiImage = UIImage(ciImage: ciImage) To fix the case where myUIImage.ciImage returns nil like you can instead … Read more

Creating a blurring overlay view

You can use UIVisualEffectView to achieve this effect. This is a native API that has been fine-tuned for performance and great battery life, plus it’s easy to implement. Swift: //only apply the blur if the user hasn’t disabled transparency effects if !UIAccessibility.isReduceTransparencyEnabled { view.backgroundColor = .clear let blurEffect = UIBlurEffect(style: .dark) let blurEffectView = UIVisualEffectView(effect: … Read more