Approve Reject View
Overview
The LMChatApproveRejectView
provides a user interface for approving or rejecting chat requests. It displays a title message and two action buttons for approval and rejection.
Functionality
Protocols
LMChatApproveRejectDelegate
func approveRequest()
: function is called when user approves the chat requestfunc rejectRequest()
: function is called when user rejects the chat request
UI Components
stackContainerView
: AnLMStackView
that holds all other UI elements vertically.titleLable
: AnLMLabel
displaying the title message.stackActionsContainerView
: AnLMStackView
that holds the action buttons horizontally.approveButton
: AnLMButton
for approving the request.rejectButton
: AnLMButton
for rejecting the request.
Methods
updateTitle(withTitleMessage:)
: Updates the title message.approveButtonClicked(_:)
: Handles the approve button tap.rejectButtonClicked(_:)
: Handles the reject button tap.
Customization
To customize the LMChatApproveRejectView
, subclass it and override the necessary methods:
CustomApproveRejectView
class CustomApproveRejectView: LMChatApproveRejectView {
override func setupAppearance() {
super.setupAppearance()
// Add custom styling here
}
}
AppDelegate.swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
LMUIComponents.shared.approveRejectRequestView = CustomApproveRejectView.self
// ...
return true
}