Category "swift"

How to properly add time to Firestore & compare it to a future timestamp to determine a subscription expiry date swift

What is the proper way to save time to Firestore & how do I get back the values to compare them & determine if a subscription is expired? I am currently

Moving Table rows in SwiftUI

Is it possible to support moving rows in a SwiftUI Table view? I know there's List which can optionally support selection and drag-and-drop to move single or mu

Swinject always return nil when trying to resolve any object

I have the following Swinject implementation in my app - import Foundation import Swinject @propertyWrapper struct Inject<Component> { let wrappedVal

SwiftUI can't redirect on receiving push notifications

I'm developing in SwiftUI and I want to get a message when I get a push notification so I can navigate to a specific part of the app. After googling I can't ge

MacOS: reading shared preferences in Swift and ObjectiveC

I have a project that mixes Swift and objective c. The controller for my preference panes is written in Swift. I can’t seem to read those preferences in O

How to get CLPlacemark from Location in SwiftLocation 5.1.0?

This is a library that doesn't have a very great documentation, In the past, I had problems migrating from a previous version to a modern version, and now, I ha

How can make a record when call coming and calling to other side in swift

When I make project with AVFoundation library it is possible to make recording my voice. But when call comes and when I call the somebody record being disabled

Gap glitch between navigation bar and table view only on iPad

This issue does not exist when my app is run on the iPhone, and it also doesn't exist in the simulator, but whenever I run the app on my physical iPad this weir

swift how to update viewModel parameter while init

I have encountered the problem "Cannot assign to property: 'self' is an immutable capture". How can i call API to check status and update "getUpdateSuccess" pa

Unable to select files form UIDocumentPickerViewController Swift

I am working on UIDocumentPickerViewController() in swift. After opening the document picker the files and images look blur and I can't able to select anyone of

How do I Set Unselected Tab Bar Item Color using Swift in Xcode with an iOS 15+ Device?

I'm trying to customize a UITabBar using Swift in Xcode, however I can't figure our how to set the color of the unselected items using the menu on the right sid

Alamofire: How to conditionally change cache policy based on network status?

The end result I would like to achieve is to use cached data when the network is unavailable and load data from the server when the network is available. The cl

Simple function for a customised label

I'm trying to write a most basic function that will set the parameters of a label. First I set the position where I want to put a label: var xCircularPos = UISc

Disable drag to select on PHPickerViewController in iOS app

I am using a PHPickerViewController in an iOS app. I want the user to be able to select multiple media, however I am noticing that it is easily to inadvertently

The data couldn’t be read because it isn’t in the correct format error

Hi guys I am trying get request when my model class like first I can get data but with second model I can get this error message "The data couldn’t be re

When observed object data changes, UI temporarily is empty

Whenever ONE conversation row changes, all of them are updated and it becomes empty for a split second. Why? https://gyazo.com/a81d437fd92e236389acdd211ff83ad3

Universal Links redirection to specific view

I'm having a hard time understanding how universal Link works. First I have tried redirection to a specific UIViewController (Universal link works as it redirec

Color cycle not cycling through all colors in swift

Can somebody help me please. I created a color cycle but it's only cycling through yellow and orange (the last 2 colors), instead of all of them. I attached a p

/usr/include/GNUstepBase/GSVersionMacros.h:359:16: fatal error: 'objc/blocks_runtime.h' file not found

I am trying to build a objective-c library integrated to a swift project on linux. I have this Package.swift for my main project: // swift-tools-version:5.5 //

Loading docx file into NSAttributesString not showing images (MacOS Swift)

I am loading docx data into an NSAttributedString, and then rendering it into an NSTextView. It mostly works, but it does not load the images, I checked the att