I know we can use UIBlurEffect
to show user a blurred image with the following code, but how to only get a blurred image (layer is better)?
let baseView = UIView(frame: CGRect(x: 0, y: 0, width: gScreenWidth, height: 90))
let backgroundImageView = UIImageView(frame: CGRect(x: 0, y: 0, width: gScreenWidth, height: 90))
let blurEffect = UIBlurEffect(style: .light)
let blurView = UIVisualEffectView(effect: blurEffect)
blurView.frame = backgroundImageView.frame
baseView.addSubview(backgroundImageView)
baseView.addSubview(blurView)