<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Distributed/DistributedActorSystem/assignID(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Distributed"
    ],
    "preciseIdentifier" : "s:11Distributed0A11ActorSystemP8assignIDy0bE0Qzqd__mAA0aB0Rd__0E0Qyd__AFRSlF"
  },
  "title" : "assignID(_:)"
}
-->

# assignID(_:)

Assign an [`ActorID`](/documentation/Distributed/DistributedActorSystem/ActorID) for the passed actor type.

```
func assignID<Act>(_ actorType: Act.Type) -> Self.ActorID where Act : DistributedActor, Self.ActorID == Act.ID
```

## Discussion

This function is invoked by a distributed actor during its initialization,
and the returned address value is stored along with it for the time of its
lifetime.

The address MUST uniquely identify the actor, and allow resolving it.
E.g. if an actor is created under address `addr1` then immediately invoking
`system.resolve(id: addr1, as: Greeter.self)` MUST return a reference
to the same actor.

---

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)