---
title: NSCursor
framework: appkit
role: symbol
role_heading: Class
path: appkit/nscursor
---

# NSCursor

A pointer (also called a cursor).

## Declaration

```swift
class NSCursor
```

## Overview

Overview The following table shows and describes the system cursors, and indicates the class method for obtaining them:  |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |  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. Balancing cursor hiding and unhiding Each call to hide() cursor must have a corresponding unhide() call. For example, [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: [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

- [init(image:hotSpot:)](appkit/nscursor/init(image:hotspot:).md)
- [init(coder:)](appkit/nscursor/init(coder:).md)

### Setting cursor attributes

- [image](appkit/nscursor/image.md)
- [hotSpot](appkit/nscursor/hotspot.md)
- [hide()](appkit/nscursor/hide().md)
- [unhide()](appkit/nscursor/unhide().md)
- [setHiddenUntilMouseMoves(_:)](appkit/nscursor/sethiddenuntilmousemoves(_:).md)

### Controlling which cursor is current

- [pop()](appkit/nscursor/pop()-swift.type.method.md)
- [pop()](appkit/nscursor/pop()-swift.method.md)
- [push()](appkit/nscursor/push().md)
- [set()](appkit/nscursor/set().md)

### Retrieving cursor instances

- [current](appkit/nscursor/current.md)
- [currentSystem](appkit/nscursor/currentsystem.md)
- [arrow](appkit/nscursor/arrow.md)
- [contextualMenu](appkit/nscursor/contextualmenu.md)
- [closedHand](appkit/nscursor/closedhand.md)
- [crosshair](appkit/nscursor/crosshair.md)
- [disappearingItem](appkit/nscursor/disappearingitem.md)
- [dragCopy](appkit/nscursor/dragcopy.md)
- [dragLink](appkit/nscursor/draglink.md)
- [iBeam](appkit/nscursor/ibeam.md)
- [iBeamCursorForVerticalLayout](appkit/nscursor/ibeamcursorforverticallayout.md)
- [openHand](appkit/nscursor/openhand.md)
- [operationNotAllowed](appkit/nscursor/operationnotallowed.md)
- [pointingHand](appkit/nscursor/pointinghand.md)
- [zoomIn](appkit/nscursor/zoomin.md)
- [zoomOut](appkit/nscursor/zoomout.md)
- [resizeDown](appkit/nscursor/resizedown.md)
- [resizeLeft](appkit/nscursor/resizeleft.md)
- [resizeLeftRight](appkit/nscursor/resizeleftright.md)
- [resizeRight](appkit/nscursor/resizeright.md)
- [resizeUp](appkit/nscursor/resizeup.md)
- [resizeUpDown](appkit/nscursor/resizeupdown.md)
- [columnResize](appkit/nscursor/columnresize.md)
- [columnResize(directions:)](appkit/nscursor/columnresize(directions:).md)
- [rowResize](appkit/nscursor/rowresize.md)
- [rowResize(directions:)](appkit/nscursor/rowresize(directions:).md)
- [frameResize(position:directions:)](appkit/nscursor/frameresize(position:directions:).md)
- [NSCursor.FrameResizeDirection](appkit/nscursor/frameresizedirection.md)

### Constants

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

### Deprecated

- [init(image:foregroundColorHint:backgroundColorHint:hotSpot:)](appkit/nscursor/init(image:foregroundcolorhint:backgroundcolorhint:hotspot:).md)
- [mouseEntered(with:)](appkit/nscursor/mouseentered(with:).md)
- [setOnMouseEntered(_:)](appkit/nscursor/setonmouseentered(_:).md)
- [isSetOnMouseEntered](appkit/nscursor/issetonmouseentered.md)
- [mouseExited(with:)](appkit/nscursor/mouseexited(with:).md)
- [setOnMouseExited(_:)](appkit/nscursor/setonmouseexited(_:).md)
- [isSetOnMouseExited](appkit/nscursor/issetonmouseexited.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)

## See Also

### Cursors

- [NSTrackingArea](appkit/nstrackingarea.md)
