LNTouchVisualizer
Touch visualizing framework for iOS.



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
.
LNTouchVisualizer
Touch visualizing framework for iOS.
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
, enterhttps://github.com/LeoNatan/LNTouchVisualizer
. Select the version you’d like to use.You can also manually add the package to your Package.swift file:
And the dependency in your target:
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 addLNTouchVisualizer.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:
Touch Visualization
The easiest way to enable touch visualization for your window scene is to add the following code in your scene delegate:
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
.