Swift

Building the user model

To have a conversation you need to store some information about a user:

  • A user's name
  • A user's JWT
  • Who they are chatting with
  • The conversation ID

To do this you will use a Struct. Open ViewController.swift and add it, replacing CONVERSATION_ID with the conversation ID created earlier:

To make things easier for later on add some static properties on the User type for the users Alice and Bob. Replacing ALICE_JWT and BOB_JWT with the values you created earlier: