Coder Social home page Coder Social logo

hujunfeng / touchvisualizer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from morizotter/touchvisualizer

0.0 1.0 0.0 63.73 MB

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

License: MIT License

Swift 86.05% Ruby 11.94% Objective-C 2.00%

touchvisualizer's Introduction

TouchVisualizer

Version License Platform Carthage compatible Circle CI Join the chat at https://gitter.im/morizotter/TouchVisualizer

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

##Features

  • Works with just a single line of code!
  • Supports multiple fingers.
  • Supports multiple UIWindow'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 2.2
  • Xcode 7.3
  • iOS8.0 or later

TouchVisualizer works with Swift 2.2 from version 1.4.0.

Installation and Setup

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

Information: To use TouchVisualizer with a project targeting iOS 8.0 or lower, you must include the TouchVisualizer.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 your Podfile and run pod install.

platform :ios, '8.0'
use_frameworks!
pod "TouchVisualizer", '~>1.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 with Homebrew using the following command:

$ brew update
$ brew install carthage

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

github "morizotter/TouchVisualizer" "1.4.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()

It is really simple, isn't it?

##Customisation

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

var config = Configuration()
config.color = UIColor.redColor()
config.image = UIImage(named: "YOUR-IMAGE")
config.showsTimer = true
config.showsTouchRadius = true
config.showsLog = true
Visualizer.start(config)

###Configuration properties

name type description default
color UIColor Color of touch point and text. default color
image UIImage Touch point image. If rendering mode is set to UIImageRenderingModeAlwaysTemplate, the image is filled with color above. circle image
defaultSize CGize Default size of touch point. 60 x 60px
showsTimer Bool Shows touch duration. false
showsTouchRadius Bool Shows touch radius by scalling touch point. It doesn't work on simulator. false
showsLog Bool Shows 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 similar touch visualisation library called COSTouchVisualizer, 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!

touchvisualizer's People

Contributors

christiansteffens avatar gitter-badger avatar morizotter avatar sixfngers avatar tulleb avatar

Watchers

 avatar

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.