I'm looking to create an EnvironmentObject that can be accessed by the View Model (not just the view). The Environment object tracks the application session da
Suppose I have a simple SwiftUI View that is not the ContentView such as this: struct Test: View { var body: some View { VStack {
I'm not sure if this is an antipattern in this brave new SwiftUI world we live in, but essentially I have an @EnvironmentObject with some basic user information
I have a ChildView with a variable: @Binding var itemName: String In this ChildView I have few buttons that change value of the variable: Button(action: {
if I set a custom Back Button (which everyone wants, hiding the ugly text ;-) ) and using .navigationBarBackButtonHidden, the standard Swipe Back gesture on the
Xcode gives the error: Function opaque return type was inferred as 'Button', which defines the opaque type in terms of itself on the line below: @State var sh
I am new to SwiftUI (iOS development). I would like to mimic the iOS Photos APP browsing behavior with SwiftUI. More specifically, I want to display a photo in
self learning beginner here. When I remove .onAppear{add()}, the preview works fine. I tried to attach it to other the body view, the Vstack but it causes anot
How to layout views in SwiftUI in such way I have input fields that I want to stretch to fill available space This inputs are placed in VStack in such way th
If I have stored a cancellable set into a ViewController: private var bag = Set<AnyCancellable>() Which contains multiple subscription. 1 - Should I canc
I have my user struct with has a dictionary of all their social medias. struct User: Identifiable { var id: String { uid } let uid, email, name, bio, profileI
I'm trying to give a shadow to Button using following code. Code: Button(action: { }) { Text("SIGN IN") .fon
I am having a little trouble here: I have a class class TempC { func GetData(){ //do stuff } } And in ContentView I want to call the func
I want to create a local backup of the CoreData sqlite file, and then have the user choose the save location with a popup. I've attached the following fileExpor
Can anybody help me? I can't find any description of the localization in Swift UI. Can anyone please give advice or better an example of how to localize for exa
I have one button on screen and on that button tap it opens one modal (view). but after closing that view, the focus of accessibility voice over goes on top of
I need to create a single dashed line. I tried going about it by creating a Rectangle view with a dashed stroke. However, when setting the height of the rectang
I'm working with SwiftUI and is trying to make a list of buttons with custom .buttonStyle inside a List view on WatchOS, but can't get it to work. Is this even
Given the following struct: struct PeopleList : View { @State var angle: Double = 0.0 @State var isAnimating = true var foreverAnimation: Animatio
I am just trying to get my updated value to display in my application after it receives a new value from bluetooth core. I know the value in the class is updati