# `GSUserDataProtocol`

*Protocol*

An interface for storing persistent data associated with a model object.

## Declaration

```swift
protocol GSUserDataProtocol : NSObjectProtocol
```

```objc
@protocol GSUserDataProtocol <NSObject>
```

```python
GSUserDataProtocol
```

## Overview

User data is intended for information that has no dedicated property on the conforming type. Values must support property-list encoding to be preserved when the containing document is saved. API clients should use stable, namespaced keys to avoid collisions with other clients.

## Topics

### Instance Properties

- [`GSUserDataProtocol.userData`](/Core/GlyphsCore/GSUserDataProtocol/userData) — Persistent values associated with the object by API clients.

### Instance Methods

- [`GSUserDataProtocol addUserData:`](/Core/GlyphsCore/GSUserDataProtocol/addUserData:) — Adds the entries from a dictionary to the user data.
- [`GSUserDataProtocol countOfUserData`](/Core/GlyphsCore/GSUserDataProtocol/countOfUserData) — The number of user-data values.
- [`GSUserDataProtocol removeUserDataForKey:`](/Core/GlyphsCore/GSUserDataProtocol/removeUserDataForKey:) — Removes the user-data value for a key.
- [`GSUserDataProtocol setUserData:forKey:`](/Core/GlyphsCore/GSUserDataProtocol/setUserData:forKey:) — Sets or removes a persistent user-data value.
- [`GSUserDataProtocol userDataForKey:`](/Core/GlyphsCore/GSUserDataProtocol/userDataForKey:) — The user-data value for a key, or `nil` if no value is set.

## Relationships

### Inherits From

- `NSObject`

### Conforming Types

- [`GSAxis`](/Core/GlyphsCore/GSAxis)
- [`GSBaseObject`](/Core/GlyphsCore/GSBaseObject)
- [`GSFont`](/Core/GlyphsCore/GSFont)
- [`GSFontMaster`](/Core/GlyphsCore/GSFontMaster)
- [`GSGlyph`](/Core/GlyphsCore/GSGlyph)
- [`GSInstance`](/Core/GlyphsCore/GSInstance)
- [`GSLayer`](/Core/GlyphsCore/GSLayer)
- [`GSNameParticle`](/Core/GlyphsCore/GSNameParticle)
- [`GSNode`](/Core/GlyphsCore/GSNode)

