Skip to content

About

Titanium iOS module providing UIKit-backed progressive and uniform background blur views.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TiVariableBlur

ti.variableblur exposes UIKit-backed progressive and uniform background blur views to Titanium on iOS. It adapts the MIT-licensed nikstar/VariableBlur implementation without embedding SwiftUI.

Screenshot

Important App Store note

The upstream implementation uses the private CAFilter variable-blur filter and internal UIVisualEffectView backdrop-layer behavior. The class and selector names are resolved dynamically, as in the upstream project, but that does not make them public API. Apple may change the behavior or reject an app that uses it. Test every supported iOS release and complete App Store review before depending on this module in production.

Build

cd ios
ti build -d . -p ios --build-only

Requirements:

  • Titanium SDK 13.3.1 or newer.
  • iOS 17 or newer.
  • Xcode with Swift 5 support.

Install

Build the module, install the generated zip, then add this to your app's tiapp.xml:

<module platform="iphone" version="1.0.0">ti.variableblur</module>

Progressive blur

const VariableBlur = require('ti.variableblur');

const blur = VariableBlur.createView({
	top: 0,
	left: 0,
	right: 0,
	height: 220,
	touchEnabled: false,
	maxBlurRadius: 20,
	direction: 'blurredTopClearBottom',
	startOffset: -0.1
});

win.add(blur);

Supported properties:

  • maxBlurRadius: maximum blur radius in points. Defaults to 20; negative values are clamped to 0.
  • direction: blurredTopClearBottom (default) or blurredBottomClearTop.
  • startOffset: gradient start coefficient. Defaults to 0; a small negative value such as -0.1 can soften the clear edge.

All properties can be updated after creation.

Uniform background blur

const backgroundBlur = VariableBlur.createBackgroundBlur({
	width: 240,
	height: 120,
	touchEnabled: false,
	radius: 20
});

win.add(backgroundBlur);

radius defaults to 20, is clamped to 0 or greater, and can be updated after creation.

Blur views are overlays: add the content to blur first, then add the blur view above it. The native implementations do not accept child views and disable interaction so touches continue to the content beneath them.

License

MIT. See LICENSE for the upstream notice and attribution.

About

Titanium iOS module providing UIKit-backed progressive and uniform background blur views.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages