Category "swift"

Using reflection to set object properties without using setValue forKey

In Swift it's not possible use .setValue(..., forKey: ...) nullable type fields like Int? properties that have an enum as it's type an Array of nullable objec

xcode ios 'No such module GoogleSignIn'

I have an ios project that works good but after i push it to git hub and clone it again from other computer i get this error 'No such module GoogleSignIn' No su

Getting error in debugger: This app has attempted to access privacy-sensitive data without a usage description

I'm having an issue in the debug area. It's saying that: "This app has attempted to access privacy-sensitive data without a usage description. The app's Info.pl

How to add polylines and annotations from user taps in SwiftUI

I am trying to drop annotations/pins wherever a user touches a certain location on the map. Whenever a user drops more 2 or more pins, it creates a polyline tha

Path extension and MIME type of file in swift

I'm learning swift , and I made a table with cells that show an image ,and classes in groups by MIME TYPE (using path extension). I had a question about extens

How to group by the elements of an array in Swift

Let's say that I have this code: class Stat { var statEvents : [StatEvents] = [] } struct StatEvents { var name: String var date: String var hours

Dismiss button in SwiftUI modal called from UIKit

I have got a SwiftUI modal view which I am calling from main UIKit view. I want to add a dismiss button to my modal view. As I can tell, there is no @State vari

Setting Autolayout Constraints on UIButton in Swift

I'm still trying to get my head around Swift Autolayouts here in XCode 6.3. I have set up a View Controller that I stuck a couple of labels on in Interface Buil

How do I atomically increment a variable in Swift?

I want to be able to increment a counter atomically and I can't find any reference on how to do it. Adding more information based on comments: Are you using GCD

Is it possible to detect if any other certain app is Currently running or not in iOS?

Let say If I want to check if the facebook or any other application is currently running on device ?

How do I refactor my code to call AppDelegate on the main thread?

I recently started migrating my project from Swift3/Xcode8 to Swift4/Xcode9. My app crashes at runtime because the main thread sanitizer allows access to UIAppl

RealityKit as a framework to build 3D nonAR apps

RealityKit has an option for .nonAR camera, but lacks fundamental options to build 3D nonAR apps, like camera control (.allowsCameraComtrol). Is it viable to us

In iOS (swift) app, registration of a second Firebase app can't receive remote notifications

I'm having two Firebase projects (on se same account, but could be two different accounts) and each project have an iOS app registered with the same bundle ID (

How to count occurrences of an element in a Swift array?

I've seen a few examples of this but all of those seem to rely on knowing which element you want to count the occurrences of. My array is generated dynamically

Xcode won't pause at this breakpoint because it has not been resolved

Shortly after updating to Xcode 13.2.1 I started seeing some weird behaviour of breakpoints. When I run an app (in a simulator) some of my breakpoints change th

Invalid Bundle - One or more dynamic libraries that are referenced by your app are not present in the dylib search path | Xcode 13.3

I am submitting a .xcarchive to the App Store via Xcode 13.3 but I keep on getting the following email error: ITMS-90562: Invalid Bundle - One or more dynamic l

How to adjust brightness contrast saturation in swift with a UISlider

I have been looking for the past couple of days on how to implement a filter to a UIImage by manually manipulating the brightness, contrast, highlight, shadows,

Horizontal scroll UICollectionView has additional line spacing?

I'm trying to use UICollectionView to make a table, when I set it to vertical scroll, everything is working great. But when I set it to horizontal scroll, it a

How to Remove UIMenuController Default Items In Swift

I'm trying to remove the items Look Up & Share... from the UIMenuController. How would I specifically remove the two and keep my custom one. Here is what I'

Best Way to Update/Edit an Array Element in SwiftUI

I have an array of identifiable Training elements. Each Training element only has two properties, name and isRequired. What is the most straight-forward (Swif