Подход:1
Код: Выделить всё
.navigationBarTitle("\(task.label)")
.navigationBarItems(trailing: UIBarButtonItem(title: "Done", style: .plain, target: self, action: #selector(self.actionName)))
Тип аргумента «UIBarButtonItem» имеет не соответствует ожидаемому типу
«Просмотр»
Подход: 2
Код: Выделить всё
.navigationBarTitle("\(task.label)")
.navigationBarItems(trailing: NavigationBarButtonItem())
struct NavigationBarButtonItem : View {
var body : some View {
Button(action: {
print("Button Tapped")
}, label: {Text("Done")})
}
}
Подробнее здесь: https://stackoverflow.com/questions/600 ... buttonitem
Мобильная версия