【发布时间】:2025-12-06 14:00:02
【问题描述】:
我使用 Simone 的解决方案来存储字符串数组并将它们呈现在 List 中:
How to Store Nested Arrays in @AppStorage for SwiftUI
我尝试在列表中添加行删除功能:
.onDelete(perform: removeRows)
func removeRows(at offsets: IndexSet) {
getStrings(data: albums).remove(atOffsets: offsets)
}
我知道这不起作用,因为函数调用返回一个不可变的值,我试图改变它。如何解决?
【问题讨论】:
-
你会显示所有上下文代码吗?
标签: swiftui