The data I pass to another view is not working – Ios swift
I'm new to swiftUI here and I want to try out to pass data between two views. But it doesn't seem to work. I'm using Xcode 13.2 & iOS 15 for the simulator. This is my code for the first…
I'm new to swiftUI here and I want to try out to pass data between two views. But it doesn't seem to work. I'm using Xcode 13.2 & iOS 15 for the simulator. This is my code for the first…
I have a protocol: import SwiftUI ... protocol MyProtocol : View { var aValue: CGFloat { get } } Then I have a property in a UIViewController: var contentView: some MyProtocol = MyView() Where MyView is: struct MyView : MyProtocol…
I'm trying to learn SwiftUI, but i can't seem to get my view to update. I want my WorkoutsView to refresh with the newly added workout when the user presses the "Add" button: WorkoutTrackerApp: @main struct WorkoutTrackerApp: App { var…
I'm having the following view hierarchy which has a retain cycle, that's the simplest I could make to reproduce the issue. All viewmodels and properties has to stay as they are needed in the original solution: import SwiftUI struct MainView:…
I have following problem. I want to create a vertical ScrollView with many rows. At the bottom of the view I have an info bar which appears over the scroll view because I put all the items in a ZStack.…
I am learning Swift and Xcode and there is a task that I have problems wrapping my mind around. There are three places where I use value formatter: format: .currency(code: Locale.current.currencyCode ?? "PLN") I packed it into a constant and…
I have a 250Gb M1 Mac Mini and it is starting to run out of disk space recently, it seems like the UI Previews is the main culprit which takes roughly 165GB space alone and is increasing each day. Tried…
I'm writing a fairly simple SwiftUI app about movies and I have this issue where the new .searchable modifier on NavigationView is always being shown, whereas it should be hidden, unless you pull down on the List. It hides it…
I've got ForEach loop inside a picker widget, that suppose to iterate a list of items (handler.items). However, in reality, I get that the tags where not properly set and $arg = $0 instead of $arg = $0.components(separatedBy: " ")[0]…
I'm working on a custom Navigation Bottom Bar. I want it to be floating but I realized that when I add .padding() on it the .clipShape() inside its background loses alignment. I have coded a simple version of the issue.…