Skip to content

Instantly share code, notes, and snippets.

@Styrmist
Styrmist / CustomIntensityVisualEffectView.swift
Created December 12, 2019 09:54 — forked from darrarski/CustomIntensityVisualEffectView.swift
UIVisualEffectView subclass that allows to customise effect intensity
import UIKit
class CustomIntensityVisualEffectView: UIVisualEffectView {
/// Create visual effect view with given effect and its intensity
///
/// - Parameters:
/// - effect: visual effect, eg UIBlurEffect(style: .dark)
/// - intensity: custom intensity from 0.0 (no effect) to 1.0 (full effect) using linear scale
init(effect: UIVisualEffect, intensity: CGFloat) {