Structure

SynchronizationComponent

A component that synchronizes an entity between processes and networked applications.

Declaration

struct SynchronizationComponent

Overview

An entity acquires a SynchronizationComponent instance by adopting the HasSynchronization protocol. All entities have this component because the Entity base class adopts the protocol.

Topics

Creating a Synchronization Component

init()

Creates a synchronization component.

Identifying a Synchronization Component

var identifier: UInt64

A unique identifier of an entity within a network session.

Managing Ownership

var isOwner: Bool

A Boolean that indicates whether the calling process owns the entity.

enum SynchronizationComponent.OwnershipTransferCompletionResult

The result of an ownership transfer request.

Registering a Component Type

static func registerComponent()

Registers a new component type.

Comparing Synchronization Components

static func == (SynchronizationComponent, SynchronizationComponent) -> Bool

Indicates whether two synchronization components are equal.

static func != (SynchronizationComponent, SynchronizationComponent) -> Bool

Indicates whether two synchronization components are not equal.

Relationships

Conforms To

See Also

Synchronizing an Entity Among Peers

var synchronization: SynchronizationComponent?

The entity’s synchronization component.

Beta
var isOwner: Bool

A Boolean that indicates whether the calling process owns the entity.

Beta
func withUnsynchronized(() -> Void)

Calls the given closure in a way such that component changes that the closure makes don’t trigger synchronization.

Beta
protocol HasSynchronization

An interface that enables an entity to be synchronized between processes and networked applications.

Beta

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software