Category "swift"

.day Component returns "incorrect" day in Swift

My date object returns "incorrect" day from some reason, I have no idea why. This output is taken from the debugger: (lldb) po date ▿ Optional<Date>

Add top shadow to TabView in SwiftUI

I have the following: I'm using a native TabView. I can change the background but I haven't been able to add a little shadow to the top of the UITabBar, I've t

Swift saving decimal to firebase

I am trying to get my numbers as accurate as possible when the user enters the information for fuel purchased. I also would like it so in the example below a us

How do you pass data dynamically is a Swift array?

Im creating a tinder like swipe app and I need a new CardData(name: "", age: "") to be created depending on how many profiles I pass through from my database. T

Swift: Unit testing delegate methods with 3rd party class as an argument

I know how to unit test with 3rd party dependencies by extending the class with your own protocol so that you can inject a mock dependency that implements that

Recenter the scrollview content Swift

I'm trying to recenter the scrollview view and move the frame, when the user current location goes to the out of the screen frame. Currently I have a PDF a

How can I make swift package management make offline? Every time I open a project, it begins downloading, which takes longer when the project is huge

Every time I open a project, it begins downloading, which takes longer when the project is huge.

Dynamically add textfields with a for each loop and a button in swiftUI

I am trying to use a ForEach loop to dynamically add textfields inside a form section with a button. Form { ForEach(0..<numberOfItems, id: \.

`Task` blocks main thread when calling async function inside

I have an ObservableObject class and a SwiftUI view. When a button is tapped, I create a Task and call populate (an async function) from within it. I thought th

swiftui matchedGeometryEffect with scaleEffect problem

Why when opening and closing the viewModel (color.green) , the circle tremble and vibrate and the model becomes above the circle when moving when i change the v

swiftui matchedGeometryEffect with scaleEffect problem

Why when opening and closing the viewModel (color.green) , the circle tremble and vibrate and the model becomes above the circle when moving when i change the v

UIButton with custom image still shows titleLabel even though I set it to blank - Swift iOS

I'm pretty new to Swift, currently writing an AR game. Seems like my issue is very basic, but I can't figure it out. I added a button to an AR Scene through the

Gmail app converting PDF on to Email not working properly on UIActivityViewController using PDFKit

Ran into some pdfkit issues when you share a PDF with UIActivityViewController and Gmail doesnt convert the PDF file properly it works on every other platform (

For tracking product impressions which Google Analytics hit type should I use?

Currently for tracking product impressions, I am using below code: let tracker = GAI.sharedInstance().defaultTracker let builder = GAIDictionaryBuilder.

How to tell when a UIMenu gets DISMISSED

I have a UIButton with a UIMenu attached, I need to know when the UIMenu is dismissed (by tapping outside the UIMenu) so I can remove the button that the UIMenu

How to does Apple Reminders App/ iOS version Google Keep able to implement recurring reminder with complex rule?

By using UNCalendarNotificationTrigger and UNNotificationRequest, it is possible to create the following recurring reminder Show reminder every day 8:00 am star

Why is my view not updating when value is updated using @Published and @ObservedObject?

I am creating an object recognition app that takes frames from the camera and outputs a description of the image into a text view on the screen. I can print the

Swift for loop not waiting for firestore call to complete

I know firestore calls are async which means this will not work: private func removeUserSavedMomentFromAllUsers(moment: StoryMoment, completion: @escaping (

Swift cocoa pods issue: '/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi_c.bundle' (mach-o file, but is an incompatible architecture...'

Is there a way to implement Amazon Polly into Swift? I followed this iOS-Example, that is given by Amazon Polly: https://docs.aws.amazon.com/polly/latest/dg/exa

How do I automatically switch to the iOS custom keyboard when entering my app?

I would like when entering my app to automatically switch to my custom keyboard like the Facemoji app. Is this possible to force user to open only custom keyboa