Код: Выделить всё
struct ArticleView: View {
@Environment(\.modelContext) private var modelContext
@Query private var articleStates: [ArticleState]
let article: Article
init(article: Article) {
self.article = article
_articleStates = Query(filter: #Predicate { $0.articleID == article.id } )
}
var body: some View {
... // SwiftUI view that depends on query data.
}
}
(https://i.sstatic.net/McqcZapB. png)
Этот метод отлично работал в iOS 17, но теперь он больше не работает. У вас есть какое-нибудь решение?
Подробнее здесь: https://stackoverflow.com/questions/791 ... -in-ios-18
Мобильная версия