Category "swiftui"

SwiftUI Calling functions from other class

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

CoreData .FileExporter creates endless local backup of sqlite file on MacOS

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

How to implement localization in Swift UI

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

How to use UIAccessibility.post(notification: .layoutChanged, argument: nil) in SwiftUI to move focus to specific view

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

SwiftUI - create a single dashed line with SwiftUI

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

How to style rows in SwiftUI List on WatchOS?

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

Repeating animation on SwiftUI Image

Given the following struct: struct PeopleList : View { @State var angle: Double = 0.0 @State var isAnimating = true var foreverAnimation: Animatio

Using @EnvironmentObject properly

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

Ignoring singular matrix, should I concerning/Ignoring to this console massage in SwiftUI?

When I am using rotation3DEffect some times the vale became 90 or -90 degree which what I planed for that, as soon as my degree hit the 90 or -90, I see a massa

Whenever I add a spacer into my code. it crashes. It works fine until then

This is simple code I made to practice with spacers. This is SwiftUI. struct Spacer: View { var body: some View{ HStack{

Baseline alignment of buttons in SwiftUI on macOS

I’m trying to vertically align a Text and a regular Button along their baselines in SwiftUI on macOS. I basically want to replicate this layout from the W

SwiftUI - Unknown preview provider "ContentView_Previews_" when previewing. Happens in a brand-new project

I have this simple view. import SwiftUI struct ContentView: View { var body: some View { Text("Hello") } } struct ContentView_Previews: Previe

Passing An ObservedObject To Nested Child Views SwiftUI (SwiftUI Data Flow)

I'm trying to understand why passing an @ObservedObject variable does not work for nested child views. The data is able to be passed but the changes only reflec

SwiftUI: How to switch to a new navigation stack with NavigationViews

I am currently using SwiftUI Beta 5. I have a workflow which involves navigating through a series of views. The last view involves an operation which populates

Add swift UI support to the framework that target's IOS 10,

I wrote framework on Swift UI, then Client told me that lower IOS was required to be supported on framework. I rewrite framework on UIKit/UIViewController, And

How to remove the default Navigation Bar space in SwiftUI NavigationView

I am new to SwiftUI (like most people) and trying to figure out how to remove some whitespace above a List that I embedded in a NavigationView. In this image, y

Select file or directory in SwiftUI in an AppKit App [duplicate]

How can I display a file dialogue in SwiftUI to choose a directory or file. I think using a NSViewRepresentable to wrap a NSOpenPanel will not

Conditional property in SwiftUI

How can I add an additional property based on a condition? With my code below I get the error: Cannot assign value of type 'some View' (result of 'Self.overlay

Swift Combine - @Published property Array

I am currently doing a project using SwiftUI and Combine. I'm on Xcode11 Beta 5. I would like to fetch my Github repositories, display them and then be able to

How to confirm an enumeration to Identifiable protocol in Swift?

I'm trying to make a list with the raw values of the cases from an enumeration with the new SwiftUI framework. However, I'm having a trouble with conforming the