Skip to content

Add blur effect in iOS with custom blur intensity to your view, labels, images etc etc

Notifications You must be signed in to change notification settings

tallhasarwar/TSBlurEffectView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

TSBlurEffectView

Add blur effect in iOS with custom blur intensity to your uiview, uilabels, uiimages etc etc

Screenshot 2021-05-20 at 19 26 27 Screenshot 2021-05-20 at 19 26 44 Screenshot 2021-05-20 at 19 27 01

Low to high intensity

Installation Manually

To use just download and include TSBlurEffectView.swift into your project and write an extension for UILabel as follow

Ho to use in UILabel

Write an extension for UILabel as follow

    extension UILabel {
      func addBlurrEffect() {
          let blurEffectView = TSBlurEffectView() // creating a blur effect view
          blurEffectView.intensity = 1 // setting blur intensity from 0.1 to 10
          self.addSubview(blurEffectView) // adding blur effect view as a subview to your view in which you want to use
      }
    
      func removeBlurEffect() {
          for subview in self.subviews {
              if subview is UIVisualEffectView {
                  subview.removeFromSuperview()
              }
          }
      }
    }

For adding yourUILable.addBlurrEffect() for adding blur effect

And yourUILable.removeBlurEffect() for removing the blur effect

Ho to use in UIView

To use just download and include TSBlurEffectView.swift into your project and write an extension for UILabel as follow

    extension UIView {
      func addBlurrEffect() {
          let blurEffectView = TSBlurEffectView() // creating a blur effect view
          blurEffectView.intensity = 1 // setting blur intensity from 0.1 to 10
          self.addSubview(blurEffectView) // adding blur effect view as a subview to your view in which you want to use
      }
    
      func removeBlurEffect() {
          for subview in self.subviews {
              if subview is UIVisualEffectView {
                  subview.removeFromSuperview()
              }
          }
      }
    }

For adding yourUIView.addBlurrEffect() for adding blur effect

And yourUIView.removeBlurEffect() for removing the blur effect

Ho to use in UIImageView

To use just download and include TSBlurEffectView.swift into your project and write an extension for UILabel as follow

    extension UIImageView {
      func addBlurrEffect() {
          let blurEffectView = TSBlurEffectView() // creating a blur effect view
          blurEffectView.intensity = 1 // setting blur intensity from 0.1 to 10
          self.addSubview(blurEffectView) // adding blur effect view as a subview to your view in which you want to use
      }
    
      func removeBlurEffect() {
          for subview in self.subviews {
              if subview is UIVisualEffectView {
                  subview.removeFromSuperview()
              }
          }
      }
    }

For adding yourUIImageView.addBlurrEffect() for adding blur effect

And yourUIImageView.removeBlurEffect() for removing the blur effect

You can add it to any UIView directly as well.