<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCursor",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCursor"
  },
  "title" : "NSCursor"
}
-->

# NSCursor

A pointer (also called a cursor).

```
class NSCursor
```

## Overview

The following table shows and describes the system cursors, and indicates the class method for obtaining them:

|Cursor                                        |Description                                                                                                                        |
|----------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
|![arrow cursor](media-2555572)                |The arrow cursor (``doc://com.apple.appkit/documentation/AppKit/NSCursor/arrow``)                                                  |
|![I-beam cursor](media-2555577)               |The I-beam cursor for indicating insertion points (``doc://com.apple.appkit/documentation/AppKit/NSCursor/iBeam``)                 |
|![cross-hair cursor](media-2555579)           |The cross-hair cursor (``doc://com.apple.appkit/documentation/AppKit/NSCursor/crosshair``)                                         |
|![closed-hand cursor](media-2555583)          |The closed-hand cursor (``doc://com.apple.appkit/documentation/AppKit/NSCursor/closedHand``)                                       |
|![open-hand cursor](media-2555589)            |The open-hand cursor (``doc://com.apple.appkit/documentation/AppKit/NSCursor/openHand``)                                           |
|![pointing hand cursor](media-2555596)        |The pointing-hand cursor (``doc://com.apple.appkit/documentation/AppKit/NSCursor/pointingHand``)                                   |
|![resize-left cursor](media-2555601)          |The resize-left cursor (``doc://com.apple.appkit/documentation/AppKit/NSCursor/resizeLeft``)                                       |
|![resize-right cursor](media-2555605)         |The resize-right cursor (``doc://com.apple.appkit/documentation/AppKit/NSCursor/resizeRight``)                                     |
|![resize-left-and-right cursor](media-2555610)|The resize-left-and-right cursor (``doc://com.apple.appkit/documentation/AppKit/NSCursor/resizeLeftRight``)                        |
|![resize-up cursor](media-2555619)            |The resize-up cursor (``doc://com.apple.appkit/documentation/AppKit/NSCursor/resizeUp``)                                           |
|![resize-down cursor](media-2555626)          |The resize-down cursor (``doc://com.apple.appkit/documentation/AppKit/NSCursor/resizeDown``)                                       |
|![resize-up-and-down cursor](media-2555629)   |The resize-up-and-down cursor (``doc://com.apple.appkit/documentation/AppKit/NSCursor/resizeUpDown``)                              |
|![disappearing item cursor](media-2555632)    |The disappearing item cursor (``doc://com.apple.appkit/documentation/AppKit/NSCursor/disappearingItem``)                           |
|![disappearing item cursor](media-2555638)    |The I-Beam text cursor for vertical layout (``doc://com.apple.appkit/documentation/AppKit/NSCursor/iBeamCursorForVerticalLayout``).|
|![](media-2555643)                            |The not allowed cursor (``doc://com.apple.appkit/documentation/AppKit/NSCursor/operationNotAllowed``).                             |
|![](media-2555647)                            |The drag link cursor (``doc://com.apple.appkit/documentation/AppKit/NSCursor/dragLink``).                                          |
|![](media-2555652)                            |The drag copy cursor (``doc://com.apple.appkit/documentation/AppKit/NSCursor/dragCopy``).                                          |
|![](media-2555658)                            |The contextual menu cursor (``doc://com.apple.appkit/documentation/AppKit/NSCursor/contextualMenu``).                              |

In macOS 10.3 and later, cursor size is no longer limited to 16 by 16 pixels.

### Cursor rectangles

In Cocoa, you can change the currently displayed cursor based on the position of the mouse over one of your views. You might use this technique to provide visual feedback about what actions the user can take with the mouse. For example, you might display one of the resize cursors whenever the mouse moves over a portion of your view that acts as a custom resizing handle. To set this up, you associate a cursor object with one or more cursor rectangles in the view.

Cursor rectangles are a specialized type of tracking rectangles, which are used to monitor the mouse location in a view. Views implement cursor rectangles using tracking rectangles but provide methods for setting and refreshing cursor rectangles that are distinct from the generic tracking rectangle interface. For information on mouse-tracking and cursor-update events, see [`NSTrackingArea`](/documentation/AppKit/NSTrackingArea).

### Balancing cursor hiding and unhiding

Each call to [`hide()`](/documentation/AppKit/NSCursor/hide()) cursor must have a corresponding [`unhide()`](/documentation/AppKit/NSCursor/unhide()) call. For example,

```objc
[NSCursor hide];
[NSCursor hide];
// ...
[NSCursor unhide];
```

Will result in the cursor still being hidden because the `hide` and `unhide` method invocations are not balanced. Instead you must balance the method calls, such as in the following example:

```objc
[NSCursor hide];
[NSCursor hide];
// ...
[NSCursor unhide];
[NSCursor unhide];
```

There are corresponding cursor `hide` and `unhide` calls, thus the cursor will become visible.

## Topics

### Initializing a new cursor

[`-  initWithImage:hotSpot:`](/documentation/AppKit/NSCursor/init(image:hotSpot:))

Initializes a cursor with the given image and hot spot.

[`-  initWithCoder:`](/documentation/AppKit/NSCursor/init(coder:))

### Setting cursor attributes

[`image`](/documentation/AppKit/NSCursor/image)

The cursor’s image.

[`hotSpot`](/documentation/AppKit/NSCursor/hotSpot)

The position of the click location within the cursor.

[`+  hide`](/documentation/AppKit/NSCursor/hide())

Makes the current cursor invisible.

[`+  unhide`](/documentation/AppKit/NSCursor/unhide())

Negates an earlier call to [`hide()`](/documentation/AppKit/NSCursor/hide()) by showing the current cursor.

[`+  setHiddenUntilMouseMoves:`](/documentation/AppKit/NSCursor/setHiddenUntilMouseMoves(_:))

Sets whether the cursor is hidden until the mouse moves.

### Controlling which cursor is current

[`+  pop`](/documentation/AppKit/NSCursor/pop()-swift.type.method)

Pops the current cursor off the top of the stack.

[`-  pop`](/documentation/AppKit/NSCursor/pop()-swift.method)

Sends a [`pop()`](/documentation/AppKit/NSCursor/pop()-swift.type.method) message to the receiver’s class.

[`-  push`](/documentation/AppKit/NSCursor/push())

Puts the receiver on top of the cursor stack and makes it the current cursor.

[`-  set`](/documentation/AppKit/NSCursor/set())

Makes the receiver the current cursor.

### Retrieving cursor instances

[`currentCursor`](/documentation/AppKit/NSCursor/current)

Returns the application’s current cursor.

[`currentSystemCursor`](/documentation/AppKit/NSCursor/currentSystem)

Returns the current system cursor.

[`arrowCursor`](/documentation/AppKit/NSCursor/arrow)

Returns the default cursor, the arrow cursor.

[`contextualMenuCursor`](/documentation/AppKit/NSCursor/contextualMenu)

Returns the contextual menu system cursor.

[`closedHandCursor`](/documentation/AppKit/NSCursor/closedHand)

Returns the closed-hand system cursor.

[`crosshairCursor`](/documentation/AppKit/NSCursor/crosshair)

Returns the cross-hair system cursor.

[`disappearingItemCursor`](/documentation/AppKit/NSCursor/disappearingItem)

Returns a cursor indicating that the current operation will result in a disappearing item.

[`dragCopyCursor`](/documentation/AppKit/NSCursor/dragCopy)

Returns a cursor indicating that the current operation will result in a copy action.

[`dragLinkCursor`](/documentation/AppKit/NSCursor/dragLink)

Returns a cursor indicating that the current operation will result in a link action.

[`IBeamCursor`](/documentation/AppKit/NSCursor/iBeam)

Returns a cursor that looks like a capital I with a tiny crossbeam at its middle.

[`IBeamCursorForVerticalLayout`](/documentation/AppKit/NSCursor/iBeamCursorForVerticalLayout)

Returns the cursor for editing vertical layout text.

[`openHandCursor`](/documentation/AppKit/NSCursor/openHand)

Returns the open-hand system cursor.

[`operationNotAllowedCursor`](/documentation/AppKit/NSCursor/operationNotAllowed)

Returns the operation not allowed cursor.

[`pointingHandCursor`](/documentation/AppKit/NSCursor/pointingHand)

Returns the pointing-hand system cursor.

[`zoomInCursor`](/documentation/AppKit/NSCursor/zoomIn)

Returns the zoom-in cursor.

[`zoomOutCursor`](/documentation/AppKit/NSCursor/zoomOut)

Returns the zoom-out cursor.

[`resizeDownCursor`](/documentation/AppKit/NSCursor/resizeDown)

Returns the resize-down system cursor.

[`resizeLeftCursor`](/documentation/AppKit/NSCursor/resizeLeft)

Returns the resize-left system cursor.

[`resizeLeftRightCursor`](/documentation/AppKit/NSCursor/resizeLeftRight)

Returns the resize-left-and-right system cursor.

[`resizeRightCursor`](/documentation/AppKit/NSCursor/resizeRight)

Returns the resize-right system cursor.

[`resizeUpCursor`](/documentation/AppKit/NSCursor/resizeUp)

Returns the resize-up system cursor.

[`resizeUpDownCursor`](/documentation/AppKit/NSCursor/resizeUpDown)

Returns the resize-up-and-down system cursor.

[`columnResizeCursor`](/documentation/AppKit/NSCursor/columnResize)

Returns the cursor for resizing a column (vertical divider) in either direction.

[`columnResize(directions:)`](/documentation/AppKit/NSCursor/columnResize(directions:))

Returns the cursor for resizing a column (vertical divider) in the specified direction.

[`rowResizeCursor`](/documentation/AppKit/NSCursor/rowResize)

Returns the cursor for resizing a row (horizontal divider) in either direction.

[`rowResize(directions:)`](/documentation/AppKit/NSCursor/rowResize(directions:))

Returns the cursor for resizing a row (horizontal divider) in the specified direction.

[`frameResize(position:directions:)`](/documentation/AppKit/NSCursor/frameResize(position:directions:))

Returns the cursor for resizing a rectangular frame from the specified edge or corner.

[`FrameResizeDirection`](/documentation/AppKit/NSCursor/FrameResizeDirection)

The direction in which a rectangular frame can be resized.

### Constants

[AppKit Versions for NSCursor Bug Fixes](/documentation/AppKit/appkit-versions-for-nscursor-bug-fixes)

The version of the AppKit framework containing a specific bug fix.

### Deprecated

[`-  initWithImage:foregroundColorHint:backgroundColorHint:hotSpot:`](/documentation/AppKit/NSCursor/init(image:foregroundColorHint:backgroundColorHint:hotSpot:))

Initializes the cursor with the specified image and hot spot.

[`-  mouseEntered:`](/documentation/AppKit/NSCursor/mouseEntered(with:))

Automatically sent to the receiver when the cursor enters a cursor rectangle owned by the receiver.

[`-  setOnMouseEntered:`](/documentation/AppKit/NSCursor/setOnMouseEntered(_:))

Specifies whether the receiver accepts [`mouseEntered(with:)`](/documentation/AppKit/NSCursor/mouseEntered(with:)) events.

[`setOnMouseEntered`](/documentation/AppKit/NSCursor/isSetOnMouseEntered)

A Boolean value indicating whether the receiver becomes current on receiving a [`mouseEntered(with:)`](/documentation/AppKit/NSCursor/mouseEntered(with:)) message.

[`-  mouseExited:`](/documentation/AppKit/NSCursor/mouseExited(with:))

Automatically sent to the receiver when the cursor exits a cursor rectangle owned by the receiver.

[`-  setOnMouseExited:`](/documentation/AppKit/NSCursor/setOnMouseExited(_:))

Sets whether the receiver accepts [`mouseExited(with:)`](/documentation/AppKit/NSCursor/mouseExited(with:)) events.

[`setOnMouseExited`](/documentation/AppKit/NSCursor/isSetOnMouseExited)

A Boolean value indicating whether the receiver becomes current when it receives a [`mouseExited(with:)`](/documentation/AppKit/NSCursor/mouseExited(with:)) message.

## Relationships

### Conforms To

[`CVarArg`](/documentation/Swift/CVarArg)

[`Copyable`](/documentation/Swift/Copyable)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Escapable`](/documentation/Swift/Escapable)

[`Hashable`](/documentation/Swift/Hashable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)