Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on May 23, 2022. It is now read-only.

Lightweight touch visualization library in Swift. A single line of code and visualize your touches!

License

NotificationsYou must be signed in to change notification settings

morizotter/TouchVisualizer

Repository files navigation

TouchVisualizer

VersionLicensePlatformCarthage compatibleCircle CIJoin the chat at https://gitter.im/morizotter/TouchVisualizer

TouchVisualizer is a lightweight pure Swift implementation for visualising touches on the screen.

Features

  • Works with justa single line of code!
  • Supports multiple fingers.
  • Supports multipleUIWindow's.
  • Displays touch radius (finger size).
  • Displays touch duration.
  • Customise the finger-points image and colour.
  • Supports iPhone and iPad in both portrait and landscape mode.

How it looks

Portrait:

one

Landscape:

two

Robots:

three

In-app implementation:

four

It's fun!

Runtime Requirements

  • Swift 4.0
  • Xcode 9.2
  • iOS9.0 or later

TouchVisualizer works with Swift 5.2 from version 4.0.0.

Installation and Setup

Note: Embedded frameworks require a minimum deployment target of iOS 9.0.

Information: To use TouchVisualizer with a project targeting iOS 8.0 or lower, you must include theTouchVisualizer.swift source file directly in your project.

Installing with CocoaPods

CocoaPods is a centralised dependency manager that automates the process of adding libraries to your Cocoa application. You can install it with the following command:

$ gem update$ gem install cocoapods$ pods --version

To integrate TouchVisualizer into your Xcode project using CocoaPods, specify it in yourPodfile and runpod install.

platform :ios,'9.0'use_frameworks!pod"TouchVisualizer",'~> 4.0'

Installing with Carthage

Carthage is a decentralised dependency manager that automates the process of adding frameworks to your Cocoa application.

You can install Carthage withHomebrew using the following command:

$ brew update$ brew install carthage

To integrate TouchVisualizer into your Xcode project using Carthage, specify it in yourCartfile:

github "morizotter/TouchVisualizer" "4.0.0"

Manual Installation

To install TouchVisualizer without a dependency manager, please add all of the files in/Pod to your Xcode Project.

Usage

To start using TouchVisualizer, write the following line wherever you want to start visualising:

import TouchVisualizer

Then invoke visualisation, by calling:

Visualizer.start()

and stop the presentation like this:

Visualizer.stop()

Get touch locations by this:

Visualizer.getTouches()

It is really simple, isn't it?

Customisation

TouchVisualizer also has the ability to customize your touch events. Here is an example of what can be customized:

varconfig=Configuration()config.color=UIColor.redColor()config.image=UIImage(named:"YOUR-IMAGE")config.showsTimer=trueconfig.showsTouchRadius=trueconfig.showsLog=trueVisualizer.start(config)

Configuration properties

nametypedescriptiondefault
colorUIColorColor of touch point and text.default color
imageUIImageTouch point image. If rendering mode is set toUIImageRenderingModeAlwaysTemplate, the image is filled with color above.circle image
defaultSizeCGSizeDefault size of touch point.60 x 60px
showsTimerBoolShows touch duration.false
showsTouchRadiusBoolShows touch radius by scaling touch point. It doesn't work on simulator.false
showsLogBoolShows log.false

Documentation

Peripheral

Presentation

Contributing

Please file issues or submit pull requests for anything you’d like to see! We're waiting! :)

Licensing

TouchVisualizer is released under the MIT license. Go read the LICENSE file for more information.

Miscellaneous

There is a similartouch visualization library calledCOSTouchVisualizer, which is written in Objective-C.COSTouchVisualizer supports earlier versions of iOS and is more mature. If TouchVisualizer isn't enough for you, try that!

About

Lightweight touch visualization library in Swift. A single line of code and visualize your touches!

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp