Category "swiftui"

SwiftUI picker on macOS

I try for my personal knowledge to learn SwiftUI. Then I test on my Mac, but my first feeling is that SwiftUI is much more iOS oriented than macOS. Am I right ?

SwiftUI - MapAnnotation is showing up in wrong position

I am trying to display multiple map annotations to Apple Maps In SwiftUI, but the annotations are showing in some wrong perspective. All positions are displayed

Unable to call Device Activity in Screen Time Api From Parent Device

Using shared authorization I am able to authorize the child's device and able to see all the installed apps on the child's mobile on the parent device. But when

SwiftUI - Detect when ScrollView has finished scrolling?

I need to find out the exact moment when my ScrollView stops moving. Is that possible with SwiftUI? Here would be an equivalent for UIScrollView. I have no idea

How can you Drag to refresh a Grid View (LazyVGrid) in Swiftui?

How do you drag to refresh a grid view in swiftui? I know you can do it with List view with refreshable modifier in iOS 15, but how can you do it with a LazyVGr

Xcode 12 SwiftUI cannot find Automatic Preview

I am working on an app in SwiftUI in Xcode 12.2. I have accidentally deleted the Automatic Preview Tab. I cannot seem to find the option to bring it back. Here

Can't show image from url in swiftUI with URLSession [duplicate]

i'm new to swiftUI and trying to create simple app for showing images from API of images i got the images from url but can't show it in Imagev

SwiftUI TabView: how to detect click on a tab?

I would like to run a function each time a tab is tapped. On the code below (by using onTapGesture) when I tap on a new tab, myFunction is called, but the tabvi

SwiftUI - NavigationView title and back button clipped under status bar after orientation change

Whenever I rotate the device to landscape and back again, the top of the NavigationView (including the title and back button) get clipped under the status bar.

Create a share sheet in iOS 15 with swiftUI

I am trying to create a share sheet to share a Text, it was working fine in iOS 14 but in iOS 15 it tells me that "'windows' was deprecated in iOS 15.0: Use UIW

SwiftUI - iOS - Using scenePhase causes views to pop when app going to background and back to active

I have a project and I am trying to implement scenePhase. The logic of the implementation seems to work fine, but I have the following strange problem. When an

SwiftUI function that returns either Text or Button?

I have a simple function to return either Text or Button, but I get the following error: Function declares an opaque return type, but the return statements in

Swift boringssl_metrics_log_metric_block_invoke(144) Failed to log metrics

I just get an error "[boringssl] boringssl_metrics_log_metric_block_invoke(144) Failed to log metrics" while to get JSON data from API link. Before it worked an

SwiftUI Create Picker with possibility to add elements

I'm trying to build a swift app with categories, I created a Picker for my categories but I would like to be able to create a Category inside the Picker itself.

contentInset on SwiftUI's List

Is there a way how to set contentInset on SwiftUI's List? I need to adjust the bottom inset to have the last item visible above the bottom button. My current s

SwiftUI navigation bar inline mode searchable issue

I've noticed a pretty big issue when using inline navigation bar display mode and searchable on my List in my app. When selecting the navigationlink it’s

How to know when SwiftUI keyboard search button tapped in .searchable search window

I am using the .searchable modifier in SwiftUI. Is there anyway to know when the user presses the search key on the keyboard? I know how to do this by using a

How can I make a background color with opacity on a Sheet view?

I'm currently developing an application using SwiftUI. I'm looking for some way to make a background color with opacity on a Sheet view. is there any way to do

SwiftUI/Combine: subscribe to value change of @Binding

I have a view with a view model, and actions in this view can change the view model. To be able to break out logic into reusable pieces, I have part of the view

SwiftUI ToolbarItem doesn't present a View from a NavigationLink

I don't know if this is a bug or I am doing something wrong here. I've added a new button on the Navigation bar that would present a new view. struct MyView: Vi