Category "swiftui"

OTC View autolayout in SwiftUI

I'm new to swiftui and swift basically, i made One-time-code screen, and here i have a problem. When i run project on my old phone (iphone 6) when keyboard appe

SwiftUI - Add Border to One Edge of an Image

It's a pretty straight-forward question - How does one apply a border effect to only the wanted edges of an Image with SwiftUI? For example, I only want to appl

How to show MPMediaItem Artwork in a SwiftUI list?

I try to build a SwiftUI List of all local stored songs on my iPhone. Im using the MediaPlayer Framework of Apple to get the songs and storing them inside an En

Focus on the next TextField/SecureField in SwiftUI

I've built a login screen in SwiftUI. I want to focus on the password SecureField when the user is finished entering their email. How can I do this? struct Logi

Padding HStack in the top of any screen

I want to put an HStack which contains two Texts in the top of any device screen. the problem is when I use padding that I have to decide fixed size of padding.

Property wrappers and SwiftUI environment: how can a property wrapper access the environment of its enclosing object?

The @FetchRequest property wrapper that ships with SwiftUI helps declaring properties that are auto-updated whenever a Core Data storage changes. You only have

SwiftUI Toolbar item getting clipped when back button is pressed

I've run in to a strange behavior in SwiftUI that I can't seem to work around. Given the following simple example app I experience this behavior: The toolbar it

SwiftUI TextField doesn't commit change when tapping another TextField

I am building some basic form functionality in my app at the moment and I am having trouble with TextFields not changing the value in the relevant binded variab

Difference between creating ViewModifier and View extension in SwiftUI

I'm trying to find out what is practical difference between these two approaches. For example: struct PrimaryLabel: ViewModifier { func body(content: Conte

Swift: task {} before iOS 15?

I am following tutorials to understand SwiftUI, and specifically how to call an API when a view appears. I saw this: List(results, id: \.trackId) { item in

WheelDatePicker is invisible in iOS 15.0

I'm building an app in SwiftUI that needs DatePicker in the custom alert. Each time I use DatePicker with a WheelDatePickerStyle, it is invisible in IOS 15.0 (a

Xcode Preview Resume Button Shortcut

Is there a keyboard-shortcut to click the resume button in the canvas on Xcode Previews, instead of clicking it every time?

Newbie SwiftUI Nested array

Please help me display my model data from api I have a nested json data response and Have a swiftui model as below ****************************MyData model stru

In SwiftUI, where are the control events, i.e. scrollViewDidScroll to detect the bottom of list data

In SwiftUI, does anyone know where are the control events such as scrollViewDidScroll to detect when a user reaches the bottom of a list causing an event to ret

How to remove highlight on tap of List with SwiftUI?

How to remove highlight on tap of List with SwiftUI? List { }.whatModifierToAddHere? The selection manager documentation doesnt say anything about it.

Getting the result of input from one view to another SwiftUI [closed]

I have this view: struct CreateBoardView: View { @State public var BoardName: String = "" var body: some View { ZStack {

What is the "some" keyword in Swift(UI)?

The new SwiftUI tutorial has the following code: struct ContentView: View { var body: some View { Text("Hello World") } } The second line the

TextField in Table behavior

I'm trying to use the new SwiftUI Table with TextField's in each row. However, the behavior of the text field's is weird, for 3 reasons: Clicking on a text fiel

SwiftUI's keyboardShortcut is not working if Button has a buttonStyle

My code: Button(action: { AudioServicesPlaySystemSound(1026) isActive.toggle() }){

WidgetKit not work for an Intent Handler to Provide Dynamic Values

I am trying to implement a widget where the user can choose a city dynamically via an intent. I followed the step by step guide provided by apple here: https://