Giter Site home page Giter Site logo

aheze / variableblurview Goto Github PK

View Code? Open in Web Editor NEW
366.0 5.0 16.0 1.67 MB

A one-file, App Store upload-safe version of Janum Trivedi's variable blur effect.

License: MIT License

Swift 100.00%
blur gradient swift swiftui blur-ramp visualeffectview

variableblurview's Introduction

VariableBlurView

A one-file, App Store upload-safe version of Janum Trivedi's variable blur effect.

(use at your own risk - Apple can still reject it).

Original author: @jtrivedi

Original repository: https://github.com/jtrivedi/VariableBlurView

React Native port: https://github.com/candlefinance/blur-view

VariableBlurView.mp4

Installation

Just drag VariableBlurView.swift into your project. Or, add the package URL:

https://github.com/aheze/VariableBlurView

How is it App Store upload-safe?

Well it still uses the CAFilter private API, but I obfuscated it as a base64 string. I've used this method in Midnight and it worked just fine.

Also, this version gets past App Review โ€” Janum's original version included a objc briding header, which gets auto-rejected. This version uses a bunch of runtime objc selectors instead.

However, it's still possible that Apple detects this, so use at your own risk.

License

Original license here.

MIT License

Copyright (c) 2023 A. Zheng

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

variableblurview's People

Contributors

aheze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

variableblurview's Issues

Unusual behavior when used in iOS 17 beta 1

In iOS 17 beta 1, it seems like VariableBlurView displays correctly the first time it's loaded in dark mode, but in the below scenarios, it seems to turn dark:

  • Switching to light mode and back to dark mode
  • Switching to another app and back when in dark mode
    I've attached a screen recording in the simulator showing the issue in the first scenario. It happens on physical devices too.
Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-06-10.at.09.55.34.mov

Pixelation on the bottom part of the gradient

The very bottom of the blur view has noticeable pixels and a hard cut. I assume this is because the standard blur layer uses a much lower sample rate because if would not be visible under a full blur. Is this something we could change to make it look nicer?

IMG_2907

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.