Category "swift"

Unable to access SPM classes in Swift classes referencing Obj-C classes

I'm currently working on moving one of our apps dependencies from Cocoapods to SPM. The dependency is written purely in Swift, but our codebase using it is both

How can I reproduce Picker's selection binding?

I'm building a custom view and I'm trying to manipulate the active state of its children. I have this: struct Menu<Content>: View where Content: View {

failed to produce diagnostic for expression, Xcode 11.4, Moya

After updating to Xcode 11.4, I started to get this error Failed to produce diagnostic for expression please file a bug report On: let provider = MoyaProvider

Can’t pass data correctly to modal presentation using ForEach and CoreData in SwiftUI

Im trying to pass data of some object from list of objects to modal sheet, fetching data from CoreData. The problem is that no matter what object I click on i

Does testflight reviews app again if i up the version number?

I have few queries about test flight build uploads . As i know the basic steps but i have questions still as this will be first time i shall be uploading build

SwiftUI - Button with Image is clickable outside

I have a ScrollView with multiple Buttons. A Button contains a Image and a Text underneath. As the images are pretty large I am using .scaledToFill and .clipp

Custom Button in SwiftUI List

SwiftUI Custom Button in List I'm trying to create a custom button in a SwiftUI List. I want it to have a blue background with white text, and importantly, to

Passing Data Forward In Swift Without Segue

I'm currently making a to do list app using Swift 4. The home view controller has a tableview with some categories in it and when one is selected, it takes the

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