如何将TargethandleInputModeList添加到SwiftUI Button

问题描述

我一直在尝试在 SwiftUI 中制作自定义键盘。关于创建自定义键盘的说明,主要是用 UIKit 编写的,这导致我的 SwiftUI 代码在配置基本按钮(删除、空格和 NextKeyboard)时出现了一些问题。

我想将此目标添加到 SwiftUI 按钮,有什么合法的方法可以做到这一点。

UIKit

@IBOutlet var nextKeyboardButton: UIButton!
self.nextKeyboardButton.addTarget(self,action: #selector(handleInputModeList(from:with:)),for: .allTouchEvents)

SwiftUI

struct KeyBoardView: View {
  var body: some View {
    Button(action: {
                   //What should I add to this action in order to perform like above UIKit code
                   },label: {Image(systemName:"globe").imageScale(.large)})
                }
             }

提前感谢您成为 SwiftUI 社区的一员!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)