Here is main part (used UIButton instead of FluentUI.Button for simplicity):
Anything(UIButton(type: .system)) {
$0.setTitle("Try me!", for: .normal)
$0.addTarget(toggleColor, action: #selector(Action.perform(sender:)), for: .touchUpInside)
toggleColor.action = {
isGreen.toggle()
}
}