Skip to main content

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 request
  • func rejectRequest(): function is called when user rejects the chat request

UI Components

  • stackContainerView: An LMStackView that holds all other UI elements vertically.
  • titleLable: An LMLabel displaying the title message.
  • stackActionsContainerView: An LMStackView that holds the action buttons horizontally.
  • approveButton: An LMButton for approving the request.
  • rejectButton: An LMButton 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
}