Report Screen
Overview
The LMChatReportViewController is used to display reporting functionality. It allows users to select a reason for reporting content and optionally provide additional details.
File Location:
LMChatReportViewController.swift
Functionality
UI Components
containerView: Main container viewcontainerScrollView: Scrollable container for the contentstackView: Vertical stack view for organizing UI elementsreportTitleLabel: Label displaying the main instructionreportSubtitleLabel: Label providing additional contextcollectionView: Collection view for displaying report reason tagsotherReasonTextView: Text view for custom report reasonssepratorView: Separator line viewsubmitButton: Button to submit the report
Methods
didTapSubmitButton(): Handles the submit button tapsetupButton(isEnabled:): Updates the submit button stateupdateTitle(): Updates the navigation title based on the report typekeyboardWillShow(_:): Adjusts scroll view insets when keyboard appearskeyboardWillHide(_:): Resets scroll view insets when keyboard disappears
Customization
CustomChatReportViewController.swift
class CustomChatReportViewController: LMChatReportViewController {
override func setupAppearance() {
super.setupAppearance()
// Add custom appearance setup here
}
override func didTapSubmitButton() {
super.didTapSubmitButton()
// Add custom handling for submit button tap
}
}
AppDelegate.swift
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
LMUIComponents.shared.reportScreen = CustomChatReportViewController.self
// ...
return true
}