NSTouchMBS class

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

NSTouchMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Cocoa MBS MacBase Plugin 23.5 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
An object representing the location, size, movement, and force of a touch occurring on the screen.

You access touch objects through UIEvent objects passed into responder objects for event handling. A touch object includes accessors for:


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.

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. more
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:

Some events using this class:

Blog Entries

Xojo Developer Magazine

Release notes


The items on this page are in the following plugins: MBS MacBase Plugin.


NSTouchBarMBS   -   NSUbiquitousKeyValueStoreMBS


💬 Ask a question or report a problem