> For the complete documentation index, see [llms.txt](https://lochiwei.gitbook.io/ios/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lochiwei.gitbook.io/ios/swift-playgrounds/learn-to-code-2/types/identifiable.md).

# ItemID

## Declaration

{% tabs %}
{% tab title="👔 ItemID" %}

```swift
// ⭐️ defined in Item.swift
public typealias ItemID = Int

public protocol Identifiable {
    /// A unique identifier that is used to describe items when
    /// sending and receiving commands.
    var id: ItemID { get }
}
```

{% endtab %}

{% tab title="👔 Identifier" %}

```swift
// internal enum (used as a namespace)
enum Identifier {
    static let undefined = -1
    static let world = 0
}
```

{% endtab %}

{% tab title="👥 相關" %}

* [Identifiable](/ios/swift/type/category/protocol/identifiable.md)
  {% endtab %}
  {% endtabs %}

:arrow\_lower\_right: inherited by：[🅿️ Item](/ios/swift-playgrounds/learn-to-code-2/types/item.md)

## Instance Property

| 屬性     | 型別     | 說明 |
| ------ | ------ | -- |
| **id** | ItemID |    |
