For questions about View - a component in Apple's SwiftUI framework that represents part of your app’s user interface and provides modifiers that you use to configure views.. When using this tag also include the more generic [swiftui] tag where possible.
Questions tagged [swiftui-view]
64 questions
0
votes
0 answers
SwiftUI - Detect when global position of a View is changing
I am actually a beginner in SwiftUI. I want to know if there is a way to detect when the global position of a View is changing. For the moment I can get the global position of the view with GeometryReader, but I definitely can't detect when it is…

Rivoks
- 1
0
votes
2 answers
SwiftUI 2.0 ReusableView that will contain a link as a variable
I am a working on an app that has a list of sports, i built a reusable view for the name and image of sports to be used to list each sport. Then i made a view for each sport to be opened when a user taps a sport image from the list of sports, i…

EMPIRE
- 57
- 7
-1
votes
1 answer
When optional starts as nil, changing value doesn't work
I'm using MVVM with Swift UI. I have the following Struct, ViewModel and View
struct Thing: Identifiable, Codable, Hashable {
var id: String = UUID().uuidString
var price: Double?
}
class MyViewModel: ObservableObject {
//****
…

snoop168
- 394
- 3
- 16
-3
votes
1 answer
SwiftUI - How to pass data from childView's viewModel to parentView's viewModel?
I have SwiftUI view1, with its viewModel1.
view1 has a child view view2 with viewModel2.
How can I pass a data for viewModel2 to viewModel1?
Thanks!