Skip to content
Snippets Groups Projects
XXClient-quick-start-guide.md 2.14 KiB

XXClient Quick Start Guide

Add XXClient library as a dependency to your project using Swift Package Manager.

▶️ Instantiating cMix

You can use a convenient CMixManager wrapper to manage cMix stored on disk:

let cMixManager: CMixManager = .live(
  passwordStorage: .init(
    save: { password in
      // securely save provided password
    },
    load: {
      // load securely stored password
    }
  )
)

let cMix: CMix
if cMixManager.hasStorage() {
  cMix = try cMixManager.load()
} else {
  cMix = try cMixManager.create()
}

Check out included example iOS application for the PasswordStorage implementation that uses the iOS keychain.

▶️ Connecting to the network

Start network follower:

try cMix.startNetworkFollower(timeoutMS: 10_000)

Wait until connected: