Other Protocols
The following protocols are available globally.
-
Protocol an ObjectBox ID must conform to. Currently, there are two major types that can be used as IDs:
EntityId<E>
which is a generic, type-safe ID struct- Id (or Int64) which is a simpler data type usable for IDs. Most methods that require you to specify an ID accept either type of ID.
Also used to constrain extensions:
extension Property where ValueType: IdBase { … }
(Swift doesn’t have parameterized extensions, or else we could write
See morewhere ValueType == EntityId<T>
.)Declaration
Swift
public protocol IdBase : EntityPropertyTypeConvertible, Hashable
-
A type that is usable as an object ID that doesn’t enforce the type of entity it is for.
Declaration
Swift
public protocol UntypedIdBase : IdBase
-
The code generator generates concrete instances of EntityBinding objects that perform the actual work of transferring database values into your Swift objects and extracting them for writing out.
As an ObjectBox user, you don’t need to deal with this (directly).
See moreDeclaration
Swift
public protocol EntityBinding : AnyObject
-
Listens to login events.
See moreDeclaration
Swift
public protocol SyncLoginListener
-
Listens to sync completed events.
See moreDeclaration
Swift
public protocol SyncCompletedListener
-
Notifies of fine granular changes on the object level happening during sync.
Note
Enabling fine granular notification can slightly reduce performance.See also
SyncCompletedListener
for the general sync listener.Declaration
Swift
public protocol SyncChangeListener
-
Listens to sync connection events.
See moreDeclaration
Swift
public protocol SyncConnectionListener
-
Listens to all possible sync events. See each protocol for detailed information.
Declaration
Swift
public protocol SyncListener : SyncChangeListener, SyncCompletedListener, SyncConnectionListener, SyncLoginListener