DittoPresence
public class DittoPresence
The entrypoint for all actions that relate presence of other peers known by the current peer, either directly or through other peers.
You don’t create one directly but can access it from a particular Ditto
instance via its presence
property.
-
Returns the current presence graph capturing all known peers and connections between them.
Declaration
Swift
public var graph: DittoPresenceGraph { get }
-
Request information about Ditto peers in range of this device.
This method returns an observer which should be held as long as updates are required. A newly registered observer will have a peers update delivered to it immediately. From then on it will be invoked repeatedly when Ditto devices come and go, or the active connections to them change.
Declaration
Swift
public func observe(didChangeHandler: @escaping (DittoPresenceGraph) -> ()) -> DittoObserver
-
A Combine publisher for presence accessible via
See moreDittoPresence
.Declaration
Swift
struct GraphPublisher : Publisher
-
A Combine publisher for the presence graph accessible via
ditto.presence
.Declaration
Swift
func graphPublisher() -> GraphPublisher
Return Value
A
GraphPublisher
which has an output ofDittoPresenceGraph
.