Category "swift"

SwiftUI | Using onDrag and onDrop to reorder Items within one single LazyGrid?

I was wondering if it is possible to use the View.onDrag and View.onDrop to add drag and drop reordering within one LazyGrid manually? Though I was able to make

SwiftUI - 2 Handle Range Slider

Is there a way, using SwiftUI, to create a Slider with 2 handles? I'm working on a project that that requires settings a low and high point for a random value t

Unit Testing Combine

I'm having difficulties testing Combine. I'm following: https://www.swiftbysundell.com/articles/unit-testing-combine-based-swift-code/ Which tests: final class

How to exclude UIViewControllers other than views from Swizzle Method?

I am trying to override viewDidAppear() methods of my custom ViewControllers and i found a solution using swizzle method. It works but when keyboard is visible,

MacOS swift: having trouble in obtaining output data from Pipe()

I am trying to run command lines to take screenshots in my Xcode project and using Pipe() to log output data. When I build and run this project in Xcode, I can

In SwiftUI what is an easy way to align more than one view in ZStack

I have a view and I want to add two icons to it, at top right side and at bottom right side. I managed to do that: I used two ZStacks: ZStack(alignment: .botto

SwiftUI - Firebase Apple Auth not authenticating

im fairly new to swiftUI... pardon the ignorance :) I have most of the code entered in my project from the instructions on the Firebase website. For some reason

Enable SwiftLint only for the new files

I have a pretty huge iOS(legacy) project in which I want to add SwiftLint. All the rules I wish to enforce, I would enforce only on new created files. In that w

.onReceive do not work when @Published property is changed [duplicate]

I have a @Published property in ViewModel and .onReceive in View. When my @Published var changes the .onReceive is not even executed. View is

UITextView - limit amount of characters per line

I have a UITextView and I want to line break each time a user is extending a limit of chars per line (let's say 30 chars per line is the maximum). And I want to

How to change title Color? swift 5

I can't change title color, which is white by default and when my background color is white too, it's invisible. How can i change it to the black color? enter i

Resize and Rotate image Annotation added in pdf

Using this Link I have added signature image annotation in PDF file But i could not find any guide for how to rotate and resize image annotation using the butto

Several animations in a collection view

I'm learning to animate collection views and currently use CollectionViewPagingLayout template. I want to use not only swipes for navigation in a collection vie

Code Signing issue when Archiving using Fastlane in Github actions

Recently we have migrated all of our iOS projects from GitLab to GitHub. However when we are trying to build the code using GitHub Actions(Fastlane) In our self

Expand SwiftUI button tap area over the button frame

I read a similar question about that issue. But that only expand the button size use .padding(). The red region in the snapshot is the tappable area. The trai

How to enable iOS time-sensitive notifications switch in app settings?

I am working on changing types of notifications in my app to time-sensitive and active on iOS 15+. I noticed that if I go to iPhone settings -> Notifications

Evaluate String expression in Swift just like javascript eval

I am getting dynamic conditions through API to apply in the application. It could be any logical expression. The task is to run all the condition received in mo

Convert [String: Any] to [String: String] in swift

How to convert a [String: Any] to [String: String] in Swift. I've tried to cast like this, but it didn't help: for (key, value) in dictionary { dictionary[

Beginner in Realm Swift - How to instantiate a new Realm in SwiftUI

I have a class DataEntry that I want to store instances of in a Realm database, but i'm having issue instantiating a Realm. Here is my DataEntry class: class Da

iOS MapBox fit camera to multiple coordinates [latitude and longitude] or annotations

in MapBox documentation for android there is LatLngBounds, but for iOS there are nothing, is there any way todo it for iOS