Category "swiftui"

One working ScrollView example and one refusing example

This is a working example of a ScrollView: var body: some View { ScrollViewReader { proxy in VStack { Button("Warp to line 10 o

Set not Removing Duplicate Dates

I have a structure that displays entries sorted by date. The date is displayed once for all entries of the same date. The problem I have is that Set is not remo

SwiftUI 3: automatic keyboard avoidance for TextField in a ScrollView doesn't include padding

The automatic keyboard avoidance feature in (SwiftUI 3) doesn't move TextField up correctly if that TextField has a padding around and is inside a ScrollView. H

SwiftUI: Update height of an existing row in list

I'm new to programming in SwiftUI. I created a list of a custom view that expands on tap. However, whenever I tap the custom view, the height of the list row do

continuous center of user with Mapkit

Good afternoon, I am having trouble displaying a map where it only centers around the user and will stay on the user with movement. My error is in my view file

continuous center of user with Mapkit

Good afternoon, I am having trouble displaying a map where it only centers around the user and will stay on the user with movement. My error is in my view file

Etymology of "sink" in SwiftUI / Combine?

I'm joining development on an existing SwiftUI / Combine iOS project, which is my first exposure to the technology. The names of functions like assign(to:on:) a

Unable to identify bug where final iteration (index) in ForEach does not update the view (SwiftUI)

Original question/post: Below is a snippet from an educational animals app for kids that is currently in beta testing. The below represents cards in a tab view

AVPlayerViewController audio continues playing in background after dismissal

My goal is to: Record a video Show it in a view and play it on a loop Dismiss it from the view Repeat with a new video Problem: Steps 1-3 work. However, the aud

SwiftUI: Array Not Updating In All Views When Referencing The Same Observed Object

I am a fairly novice developer. I wrote an app for tracking indoor bouldering climbs all in 1 really large file. It was working fine, just hard to maintain. Now

How to get the List's offset when adding an element in SwiftUI

I want to get the list's offset to achieve pagination. So, I wrote like below. ContentView.swift import SwiftUI struct ContentView: View { @State var list =

How to change back button text in iPad in Swift UI?

Working on iPhone, iPad and Mac OS app, which has login screen. I took login View in NavigationView, when I tap on back button the login view will slide as spli

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