Structures

The following structures are available globally.

  • A conversation is a thread of messages with some user that you have added.

    Conversations have an unique id and holds all the messages in that conversation. This includes the messages that you have sent as well.

    See more

    Declaration

    Swift

    struct Conversation : Identifiable
  • A device is created when a new Bluetooth connection is made.

    It is used to keep track of connected devices and keep a reference in memory of newly connected devices since connections are dropped otherwise.

    See more

    Declaration

    Swift

    struct Device
  • Local messages are messages meant to be stored on device.

    Local messages act just like a regular message but with more detailed information. This is done to limit the size of the message sent between devices while upholding information in a single struct on the receiving device.

    See MessageModel.swift

    See more

    Declaration

    Swift

    struct LocalMessage : Identifiable, Hashable
  • Message objects are the objects sent between devices.

    We fill in the message struct and send it off formatted as JSON.

    See more

    Declaration

    Swift

    struct Message : Codable, Identifiable
  • The Service struct keeps information that we may need across the app. This includes the UUID of the apps Bluetooth service as well as the Characteristics UUID.

    See more

    Declaration

    Swift

    struct Service
  • The ChatView displays a conversation and all the messages that have been sent and received in said conversation.

    It is also here that we send new messages.

    See more

    Declaration

    Swift

    struct ChatView : View
  • A simple shape of a bubbble.

    See more

    Declaration

    Swift

    struct Bubble : Shape
  • The beautiful bubbles messages are displayed in.

    This view is used as a subview in ChatView.

    See more

    Declaration

    Swift

    struct MessageBubble : View
  • The small status image of a message. An eye for example means that the receiver of the message has seen it.

    See more

    Declaration

    Swift

    struct MessageStatus : View
  • Undocumented

    See more

    Declaration

    Swift

    struct ConnectionView : View
  • A snapping carousel view used for the onboarding experience for dIM.

    It works as a few slides of short explanatory slides giving users a first impression of what dIM is and how it works.

    See more

    Declaration

    Swift

    struct SnapCarousel : View
  • The HomeView where users are presented with the different conversations that they are in. It is also here that we redirect them to other pages, let it be the ChatView or the SettingsView.

    See more

    Declaration

    Swift

    struct HomeView : View
  • The QRView gets the users public key in a string format, then generates a QR code and displays it nicely.

    See more

    Declaration

    Swift

    struct QRView : View
  • SetUpView handles all initial first logins where users choose a username and are then redirected to ContentView which is the main View of the app.

    See more

    Declaration

    Swift

    struct SetUpView : View
  • The About section in the SettingsView. This is the small dim icon in the top of the settings as well as the description.

    See more

    Declaration

    Swift

    struct AboutView : View
  • The connectivityView is used for showing the user current connections.

    It also shows a few statistics for this session.

    See more

    Declaration

    Swift

    struct ConnectivityView : View
  • The support view which contains contact information for dIM.

    This is a subview of the SettingsView.swift view.

    See more

    Declaration

    Swift

    struct SupportView : View
  • The READ setting toggle which is a setting that can be turned on and off based on user preferences.

    If it is enabled then the sender of messages can see that you have read their messages.

    Note

    Default value is off.
    See more

    Declaration

    Swift

    struct ReadToggle : View
  • The main SettingsView which shows a number of subviews for different purposes.

    It is here that we set new usernames and toggles different settings. It also shows contact information for dIM among other things.

    See more

    Declaration

    Swift

    struct SettingsView : View