Listen to user actions

Implementation

You can listen to user actions through the VFActionsCallbacks object.

let callbacks: VFActionsCallbacks = { type in
   switch type {
       case .seeMoreCommentsPressed:
            break
       default:
            break
   }
}
        
guard let preCommentsViewController = VFPreviewCommentsViewController.new(containerId: articleViewModel.story.containerId, articleMetadata: articleViewModel.articleMetadata, loginDelegate: self, settings: settings) else {
    return
}
        
preCommentsViewController.setActionCallbacks(callbacks: callbacks)
let callbacks: VFActionsCallbacks = { type in
    switch type {
        case .closeNewCommentPressed:
        break
        default:
        break
  }
}
        
guard let newCommentViewController = VFNewCommentViewController.new(newCommentActionType: actionType, containerId: containerId, articleMetadata: articleMetadata, loginDelegate: self, settings: settings) else{
    return
}
newCommentViewController.setActionCallbacks(callbacks: callbacks)
let callbacks: VFActionsCallbacks = { type in
    switch type {
        default:
           break
    }
}
        
guard let profileViewController = VFProfileViewController.new(userUUID: userUUID, presentationType: presentationType, loginDelegate: self, settings: settings) else{
    return
}
profileViewController.setActionCallbacks(callbacks: callbacks)

VFActionCallbackType

VFActionCallbackType

Description

closeNewCommentPressed

Close new comment button pressed

seeMoreCommentsPressed()

See more comments button pressed

writeNewCommentPressed(let actionType)

New comment box pressed

openProfilePressed(let userUUID)

Open profile view pressed

closeProfilePressed

Close profile button pressed


What’s Next
Did this page help you?