Category "swiftui"

Swift UI - User Location is not centered on mapkit, resizing Map jumps back to location

I want to build a map which shows the user location, the zoom scale and can be switched between standard maptype and hybrid maptype. For testing reasons, I didn

SwiftUI navigationLink isActivie not working [closed]

Purpose My intention is to come back from view3 and return directly to view1 Current Status My view hierarchy here is view1 -> view2 ->

Is it possible to make the LazyVGrid header have the same appearance as a List header

Goal My goal is to make the LazyVGrid header look exactly the same as the List header. When utilizing the Grid view, the header is transparent and shows the con

SwiftUI Firebase Pagination Order Users by id

I have a page for users in a grid view and would like to paginate the view to reduce bandwidth when a user scrolls. For now i know how to paginate a feed view b

Create common layout for Navigation Bar in SwiftUI So other SwiftUI views should reuse same Nav Bar

In iOS SwiftUI, How we can make a common layout for Navigation Bar. So we can use that in all project without re-write the same code. We can use ViewBuilder to

SwiftUI: How can you make your app come to the front when clicking on the dock icon of the app?

When a SwiftUI app is minimized and the dock icon is clicked. The app won't be deminimized and put to the front just like other apps do. import SwiftUI @main s

How to move a view/shape along a custom path with swiftUI?

There doesn't seem to be an intuitive way of moving a view/shape along a custom path, particularly a curvy path. I've found several libraries for UIKit that all

Unicode char has odd gap when rendered in view

I am using the following code to show a playing card. Not sure why there is a large gap at the top. This is on iOS 15.4 var body: some View { Text(String(Ch

How to make a non-observable class's methods available to SwiftUI views?

I have a pretty complicated UI so I broke my view models into multiple observable object classes that manage each part of the UI. The 2 view model instances are

Disclosure group open/close animation

I'm trying to animate the opening and closing of a disclosure group. I've tried several attempts without being able to get any sort of animation. This code synt

Admob crash on iPad with Window container should not be nil

I am trying to integrate Admob. SDK version is 9.0. I copied the code from https://medium.com/geekculture/adding-google-mobile-ads-admob-to-your-swiftui-app-in-

Visualize Table in SwiftUI

How can I visualize this data as table in SwiftUI: I have an invoice object with pages and tables and cells. The cells do have information about rowIndex and co

Why is ForEach not changing my Foreground color correctly in SwiftUI?

I am trying to make a simple Todo app and I'm trying to implement a feature where if I click on a row, the foreground color will be change. However, I have two

Editing a TextField in preview

I am trying to add a TextField in SwiftUI. It successfully appears with the initial text, but it is not editable in the preview display, only when I run a simul

SwiftUI tvOS custom Button missing accessibility Focused state

TL;DR: Is there any way to have custom button style (custom pressed state) in SwiftUI on tvOS while it is still working correctly with Accessibility Focus API a

Focus on a TextField using a keyboard shortcut

I have a macOS Monterrey app that has a TextField on the toolbar. I use this to search for text on my app. Now, I'm trying to add a keyboard shortcut to focus o

How the remove the yellow bar for "strong password" for SecureFields in SwiftUI?

I am new to SwiftUI and am trying out the SecureFields now. I am using two SecureFields in one VStack and for some reason when I use the iOS keyboard they show

Simple app for tvOS - but not simple for me. Looping my movie

I'm total newbie in coding and are trying to make a small app for my own. This is working as I want but I've no idea how to make the movie loop? Tried to look e

Memory leak issue virtual camera macOS, swift SwiftUI zoom caphost

We are developing a application with virtual camera plugin for macOS by using swiftUI & swift. It has also C++ & objective C library. When we use that p

SwiftUI - Adding a keyboard toolbar button for only one TextField adds it for all TextFields

Background I have two TextFields, one of which has a keyboard type of .decimalPad. Given that there is no 'Done' button when using a decimal pad keyboard to clo