I added the functionality to be able to delete a message by clicking a "delete" button.
How
I realized that we can access the MessageView class when we set up the buttons' gestures. Adding a deleteButton property to the MessageView allowed me to later access that property inside of ARVC+UserGuestures and setting the tapped function there. I had to create a subclass of UIButton with an added messageEntity property because the action in addTarget only takes in UIButton type classes.
Update
I added the functionality to be able to delete a message by clicking a "delete" button.
How
I realized that we can access the
MessageView
class when we set up the buttons' gestures. Adding adeleteButton
property to theMessageView
allowed me to later access that property inside ofARVC+UserGuestures
and setting the tapped function there. I had to create a subclass ofUIButton
with an addedmessageEntity
property because the action inaddTarget
only takes inUIButton
type classes.