Platforms to show: All Mac Windows Linux Cross-Platform
NSTouchMBS class New in 23.5
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Cocoa | MBS MacBase Plugin | 23.5 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | Desktop & iOS |
You access touch objects through UIEvent objects passed into responder objects for event handling. A touch object includes accessors for:
- The view or window in which the touch occurred
- The location of the touch within the view or window
- The approximate radius of the touch
- The force of the touch (on devices that support 3D Touch or Apple Pencil)
A touch object also contains a timestamp indicating when the touch occurred, an integer representing the number of times the user tapped the screen, and the phase of the touch in the form of a constant that describes whether the touch began, moved, or ended, or whether the system canceled the touch.
To learn how to work with swipes, read Handling Swipe and Drag Gestures in Event Handling Guide for UIKit Apps.
A touch object persists throughout a multi-touch sequence. You may store a reference to a touch while handling a multi-touch sequence, as long as you release that reference when the sequence ends. If you need to store information about a touch outside of a multi-touch sequence, copy that information from the touch.
Using NSTouch on macOS and UITouch on iOS.
This is an abstract class. You can't create an instance, but you can get one from various plugin functions.
- 11 properties
- property force as Double
- property Handle as Integer
- property majorRadius as Double
- property majorRadiusTolerance as Double
- property maximumPossibleForce as Double
- property phase as Integer
- property tapCount as Integer
- property timestamp as Double
- property type as Integer
- property view as NSViewMBS
- property window as NSWindowMBS
- 3 methods
- method Constructor Private
- method locationInView(View as NSViewMBS) as NSPointMBS
- method previousLocationInView(View as NSViewMBS) as NSPointMBS
- 5 constants
Touch Types
Constant | Value | Description |
---|---|---|
TouchTypeDirect | 0 |
A touch resulting from direct contact with the screen. |
TouchTypeIndirect | 1 |
A touch that doesn’t result from contact with the screen. Indirect touches are generated by touch input devices that are separate from the screen. For example, the trackpad of an Apple TV remote generates indirect touches. |
TouchTypeIndirectPointer | 3 |
A touch resulting from a button-based, indirect input device that describes the input sequence from button press to button release. |
TouchTypePencil | 2 |
A touch from Apple Pencil. A pencil touch occurs when Apple Pencil interacts with the device’s screen. |
TouchTypeStylus | 2 |
A touch from a stylus. |
This class has no sub classes.
Some methods using this class:
- NSEventMBS.allTouches as NSTouchMBS()
- NSEventMBS.touchesForView(view as NSViewMBS) as NSTouchMBS()
- NSEventMBS.touchesForWindow(win as NSWindowMBS) as NSTouchMBS()
Some events using this class:
- MapKitIOSControlMBS.touchesBegan(e as NSEventMBS, touches() as NSTouchMBS) as boolean
- MapKitIOSControlMBS.touchesCancelled(e as NSEventMBS, touches() as NSTouchMBS) as boolean
- MapKitIOSControlMBS.touchesEnded(e as NSEventMBS, touches() as NSTouchMBS) as boolean
- MapKitIOSControlMBS.touchesMoved(e as NSEventMBS, touches() as NSTouchMBS) as boolean
- SCNIOSControlMBS.touchesBegan(e as NSEventMBS, touches() as NSTouchMBS) as boolean
- SCNIOSControlMBS.touchesCancelled(e as NSEventMBS, touches() as NSTouchMBS) as boolean
- SCNIOSControlMBS.touchesEnded(e as NSEventMBS, touches() as NSTouchMBS) as boolean
- SCNIOSControlMBS.touchesMoved(e as NSEventMBS, touches() as NSTouchMBS) as boolean
Blog Entries
- MonkeyBread Software Releases the MBS Xojo Plugins in version 23.5
- MBS Xojo Plugins, version 23.5pr7
Release notes
- Version 23.5
- Added NSTouchMBS class for macOS and iOS (using UITouch on iOS).
The items on this page are in the following plugins: MBS MacBase Plugin.
NSTouchBarMBS - NSUbiquitousKeyValueStoreMBS
