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

To do this you will use a Struct. Open the ViewController.swift file and add it below the class.

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