VariableBlur

1.1.1

SwiftUI variable blur (progressive blur)
nikstar/VariableBlur

What's New

1.1.1

2024-05-02T21:10:23Z

What's Changed

  • Fix crash when VariableBlurView is removed from the view hierarchy and added back by @nikstar in #4

Full Changelog: v1.1.0...v1.1.1

VariableBlur

SwiftUI variable blur (progressive blur)

First of all, all hard work was done by jtrivedi - I just made some minor adjustments.

Changes in this version:

  • all code is in one file
  • dynamically generates gradient image allowing for further adjustments
  • fixes crash when switching between light and dark mode
  • supports upside down variable blurs (clear at the top, blurred at the bottom)

Use of private API did not trigger App Store rejection for me but do tell if it does for you.

Install

Recommended

Copy VariableBlur.swift to your project.

SPM

To add a package dependency to your Xcode project, select File > Add Package and enter this repository's URL (https://github.com/nikstar/VariableBlur).

Example

At top matching cutout safety area:

MyContentView()
    .overlay(alignment: .top) {
        GeometryReader { geom in
            VariableBlurView(maxBlurRadius: 10)
                .frame(height: geom.safeAreaInsets.top)
                .ignoresSafeArea()
        }
    }

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

  • None
Last updated: Fri May 03 2024 05:12:58 GMT-0900 (Hawaii-Aleutian Daylight Time)