If a status in a conversation view controller creates a work item to
update the timestamp in 1 minute, but the view controller is deinit'd
before that time elapses, the mastodonController instance will be nil,
resulting in a crash.
The DispatchWorkItems's are cancelled by the respective cell deinit
methods. But if the work item has already begun, cancelling it has no
effect, potentially leading to a crash in the conditions described above
are true. Using a weak reference to self fixes this.
Additionally, don't unnecessarily recreate the work items every time.
They don't capture any local variables, only self, so nothing changes.
instead of enum
Additional categories can be added, which would cause a crash when
decoding.
As the category isn't used for anything, storing it as an enum value is
not necessary.
The timestamp update work item shouldn't retain a reference to the cell.
It can be unowned because when the cell is deinit'd, the work item will
be cancelled.
instead of enum
Additional categories can be added, which would cause a crash when
decoding.
As the category isn't used for anything, storing it as an enum value is
not necessary.
Instead of simply returning the content text view from hitTest(_:with:),
we need to call the super method so that the system still performs its
own checks.
UITextView uses TextKit internally, unlike UILabel, so no additional
code is needed to keep the TextKit and view representations of the text
in sync since they are one and the same. This means that detecting which
character was tapped in a content text view is much more accurate, which
means link handling is substantially imrpoved.
Fixes#20
dependency injection
The places still using the .shared property are cases where there is no
view controller from which to (easily) get the appropriate instance,
such as user activity and X-Callback-URL handling. These uses will need
to be revisited once there are multiple MastodonControllers.
See #16