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 moreDeclaration
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 moreDeclaration
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 moreDeclaration
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 moreDeclaration
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 moreDeclaration
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 moreDeclaration
Swift
struct ChatView : View
-
A simple shape of a bubbble.
See moreDeclaration
Swift
struct Bubble : Shape
-
The small status image of a message. An eye for example means that the receiver of the message has seen it.
See moreDeclaration
Swift
struct MessageStatus : View
-
Undocumented
See moreDeclaration
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 moreDeclaration
Swift
struct SnapCarousel : View
-
The
See moreHomeView
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 theChatView
or theSettingsView
.Declaration
Swift
struct HomeView : View
-
The
See moreQRView
gets the users public key in a string format, then generates a QR code and displays it nicely.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 moreDeclaration
Swift
struct SetUpView : View
-
The
See moreAbout
section in theSettingsView
. This is the small dim icon in the top of the settings as well as the description.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 moreDeclaration
Swift
struct ConnectivityView : View
-
The support view which contains contact information for dIM.
This is a subview of the
See moreSettingsView.swift
view.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.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 moreDeclaration
Swift
struct SettingsView : View