Category "swift"

Remove default padding from List in SwiftUI

When using ScrollView the views inside it are spread across the whole screen width by default, but when using List, there is a padding on the sides. Is there a

SwiftUI using NSSharingServicePicker in MacOS

I am trying to use a Share function inside my MacOS app in SwiftUI. I am having a URL to a file, which I want to share. It can be images/ documents and much mor

Parse JSON Data Array with Swift 4

I am using the following code. It only works if the JSON data does not start with a '[' character. It works fine for JSON data starting with a '{' character.

How to implement AdMob Open Ad in a SwiftUI project with SwiftUI App Cycle?

I'm trying to implement AdMob open ad in a SwiftUI project using Google's documentation: https://developers.google.com/admob/ios/app-open-ads. The problem is th

Using Foundation Decimal type in XCTAssertEqual

I am building some classes and code that store and perform arithmetic on currency values. I was originally using Doubles, but converted to Decimal due to arithm

SwiftUI: Pop to root view when selected tab is tapped again

Starting point is a NavigationView within a TabView. I'm struggling with finding a SwiftUI solution to pop to the root view within the navigation stack when the

Xcode stuck in "Uploading package to the App Store" stage while uploading

I have tried to upload an application to Test Flight. The app is successfully validated. However, when distributing, Xcode is stuck in the "Uploading" stage as

How to make a Swift enum with associated values equatable

I have an enum of associated values which I would like to make equatable for testing purposes, but do not know how this pattern would work with an enum case wit

SwiftUI modal presentation works only once from navigationBarItems

Here is a bug in SwiftUI when you show modal from button inside navigation bar items. In code below Button 1 works as expected, but Button 2 works only once: s

EXC_BAD_ACCESS when initializing Dictionary of CurrentValueSubject in Swift

I am trying to create a class that executes data loading once and returns the data to all callers of the method while the data was loading to not perform the da

SwiftUI: List does not update automatically after deleting all Core Data Entity entries

I know SwiftUI uses state-driven rendering. So I was assuming, when I delete Core Data Entity entries, that my List with Core Data elements gets refreshed immed

firebase.auth().currentUser and onAuthStateChanged always null inspite of being signed in

The firebase.auth().currentUser is always null, as is the onAuthStateChanged listener in my node.js code. However, the user is signed in at my front end swift a

UIVideoEditorController delegate method called twice

I'm using UIVideoEditorController, but the success delegate method called twice for me. However, all pointers of all passed objects tell it sends exactly the sa

Cannot make USSD calls with symbols * # in iOS 15.4

Up until iOS 15.3 users were able to make USSD calls from within my app, considering USSD calls include symbols * and #, but as of 15.4 that seems to no longer

KMM - Casting a sealed class/interface in swift not possible

Within my KMM library I use sealed interfaces/classes to represent certain states/errors. I decided to use sealed interfaces/classes because these states must h

Run injected JavaScript script only once WKWebView web page has fully loaded

I want to run a particular script in WKWebView only once the webpage has fully loaded (including images). What I've been doing so far is running the function fu

How to get client IP address in Vapor 3.0?

Although there used to be some methods to get client IP address (e.g. req.peerHostname ), I cannot figure out how to get it in Vapor 3.0. Could anyone please l

SwiftUI drag gesture across multiple subviews

I'm attempting to create a grid of small square views, that when the user hovers over them with their thumb (or swipes across them), the little squares will tem

iOS Extending background time for beacon monitoring

I'm developing an iOS swift app for traveling, the concept of the app is after validating the trip with the user, while in trip, the app keeps ranging for bluet

EventKit remove event from calendar

This is the way I am adding all the events in to my calendar, those events are coming from table view. I have a problem with deleting a specific even from the c