CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.

Touchr 0.1.3

Touchr 0.1.3

Maintained by Sebastian Boldt.



Touchr 0.1.3

Touchr

Handle Multitouchevents the easy way

Touchr

current version twitter handle Swift 4 compatible platform license

Touchr helps you with handling Multitouch-Events.

📱 Example

To run the example project, clone the repo, and run pod install from the Example directory first.

🔧How to use

Touchr is super easy to use.

Just create a Touchr Object and declare it as your nextResponder inside your View or ViewController. You can currently just subscribe using Rx but i will implement oldschool delegate methods soon.

Two Types of events will be fired.

  • releaseOfTouch(touch: TouchDescriptor)
  • touch(touches: Set)
  • TouchDescriptor (when touch started, which finger and actual touch object)
class MultiTouchViewController: UIViewController {
  lazy var touchr: Touchr = {
    var touchr = Touchr(maximumNumberOfSimultaneousTouches: 3)
    return touchr
  }()

  override var next: UIResponder? {
    return touchR
  }
   
  override func viewDidLoad() {
        super.viewDidLoad()
        touchr.touchStream.subscribe(onNext: { event in
            switch event {
              case .releaseOfTouch(let touchDescriptor):
                // Handle release of Fingers over here
              case .touch(let lastTouches):
                // Handle touches over here
            }
        }).disposed(by: bag)
    }
}

That's it. That's lit.

✅ Requirements

Deployment target of your App is >= iOS 9.1

📲 Installation

Touchr is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "Touchr"

🤖 Author

Sebastian Boldt, http://sebastianboldt.com

📄 License

Touchr is available under the MIT license. See the LICENSE file for more info.