Swiftpack.co - LeoNatan/LNTouchVisualizer as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by LeoNatan.
LeoNatan/LNTouchVisualizer 1.0.3
Touch visualizing framework for iOS
⭐️ 23
🕓 2 years ago
iOS
.package(url: "https://github.com/LeoNatan/LNTouchVisualizer.git", from: "1.0.3")

LNTouchVisualizer

Touch visualizing framework for iOS.

GitHub release GitHub stars GitHub license PayPal Donation Button

GitHub issues GitHub contributors

Adding to Your Project

Swift Package Manager

Swift Package Manager is the recommended way to integrate LNTouchVisualizer in your project.

LNTouchVisualizer supports SPM versions 5.1.0 and above. To use SPM, you should use Xcode 11 to open your project. Click File -> Swift Packages -> Add Package Dependency, enter https://github.com/LeoNatan/LNTouchVisualizer. Select the version you’d like to use.

You can also manually add the package to your Package.swift file:

.package(url: "https://github.com/LeoNatan/LNTouchVisualizer.git", from: "1.0")

And the dependency in your target:

.target(name: "BestExampleApp", dependencies: ["LNTouchVisualizer"]),

Carthage

Add the following to your Cartfile:

github "LeoNatan/LNTouchVisualizer"

Make sure you follow the Carthage integration instructions here.

Manual

Drag the LNTouchVisualizer.xcodeproj project to your project, and add LNTouchVisualizer.framework to Embedded Binaries in your project target's General tab. Xcode should sort everything else on its own.

CocoaPods

CocoaPods is not supported. There are many reasons for this. Instead of CocoaPods, use Carthage. You can continue using CocoaPods for for your other dependencies and Swift Package Manager for LNTouchVisualizer.

Using the Framework

Swift

While the framework is written in Objective C, it uses modern Objective C syntax, so using the framework in Swift is very easy and intuitive.

Project Integration

Import the module in your project:

import LNTouchVisualizer

Touch Visualization

The easiest way to enable touch visualization for your window scene is to add the following code in your scene delegate:

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
	guard let scene = (scene as? UIWindowScene) else { return }
	scene.touchVisualizerEnabled = true
 
	//This is to configure the system touch visualizer window.
	let rippleConfig = LNTouchConfig.ripple
	rippleConfig.fillColor = .systemRed
	scene.touchVisualizerWindow.touchRippleConfig = rippleConfig
}

This will enable touch visualization for your entire scene by adding a passthrough window for touch visualizations, while allowing you to use your own windows for your app’s UI.

If you’d like to use a touch visualization window on your own, check out the LNTouchVisualizerWindow.h header for more information.

Acknowledgements

Based on COSTouchVisualizer.

GitHub

link
Stars: 23
Last commit: 2 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

v1.0.3
2 years ago
  • Removed a warning from the Package.json

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics