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 |
---|
closeNewCommentPressed |
authPressed(let promptType) |
replyPosted(let contentUUID) |
commentPosted(let contentUUID) |
seeMoreCommentsPressed() |
writeNewCommentPressed(let actionType) |
openProfilePressed(let userUUID) |
closeProfilePressed |
trendingArticlePressed(let metadata, let containerId) |
notificationPressed(let presentationType) |
Updated 11 months ago
What’s Next