跳转到内容
搜索文档

RtkMoreMenu

最后更新 查看 MarkdownAgent 设置

一个底部工作表菜单,显示聊天、投票和参与者列表等会议操作选项。

初始化器参数

参数 类型 必填 默认值 描述
title String? nil 在菜单顶部显示的可选标题
features [MenuType] - 要显示的菜单项数组
onSelect @escaping (MenuType) -> Void - 用户选择菜单项时调用的闭包

方法

方法 返回类型 描述
show(on:) Void 在指定的 UIView 上以底部工作表形式呈现菜单
reload(title:features:) Void 使用新标题和功能集重新加载菜单

使用示例

基本用法

import RealtimeKitUI

let menu = RtkMoreMenu(
    features: [.chat, .polls, .participants],
    onSelect: { menuType in
        print("Selected: \(menuType)")
    }
)
menu.show(on: self.view)

带标题

import RealtimeKitUI

let menu = RtkMoreMenu(
    title: "More Options",
    features: [.chat, .polls, .participants],
    onSelect: { menuType in
        switch menuType {
        case .chat:
            print("Open chat")
        case .polls:
            print("Open polls")
        case .participants:
            print("Open participants")
        default:
            break
        }
    }
)
menu.show(on: self.view)

这篇文档对您有帮助吗?