Tactile is a safer and more idiomatic way to respond to gestures and control events. It lets you catch bugs at compile time and write more expressive code.
Usage • Installation • License
Usage
Tactile extends both UIView
and UIControl
classes.
UIView extensions
The on
method
Use the on
method to add gesture recognizers.
on(gesture:callback:)
on(gesture:state:callback:)
on(gesture:states:callback:)
on(gesture:callbacks:)
The shorthand methods
Tactile defines 6 shorthand methods: longPress
, pan
, pinch
, rotation
, swipe
and tap
.
<shorthand>(callback:)
<shorthand>(state:callback:)
<shorthand>(states:callback:)
<shorthand>(callbacks:)
The off
method
Use the off
method to remove gesture recognizers.
off(gesture:)
off(gestureType:)
off()
Attaching a gesture recognizer to multiple views
With Tactile, you can attach the same gesture recognizer to multiple views.
UIControl extensions
Use the on
method to attach an event handler function for one or more control events.
on(event:callback:)
on(events:callback:)
on(callbacks:)
Installation
Carthage
Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.
You can install Carthage with Homebrew using the following command:
To integrate Tactile into your Xcode project using Carthage, specify it in your Cartfile
:
CocoaPods
CocoaPods is a dependency manager for Cocoa projects.
You can install it with the following command:
To integrate Tactile into your Xcode project using CocoaPods, specify it in your Podfile
:
License
Copyright (c) 2015-2019 Damien