---
title: "giveOwnership(of:toPeer:)"
framework: realitykit
role: symbol
role_heading: Instance Method
path: "realitykit/synchronizationservice/giveownership(of:topeer:)"
---

# giveOwnership(of:toPeer:)

Transfers ownership of the given entity to the named network device.

## Declaration

```swift
@discardableResult @MainActor @preconcurrency func giveOwnership(of entity: Entity, toPeer: any SynchronizationPeerID) -> Bool
```

## Parameters

- `entity`: The entity whose ownership is transferred.
- `toPeer`: The networked device receiving ownership.

## Return Value

Return Value A Boolean that’s true if the ownership transfer succeeds.

## See Also

### Managing ownership

- [owner(of:)](realitykit/synchronizationservice/owner(of:).md)
