Category "swift"

Offset doesn't reset after onTapGesture - SwiftUI

Im trying to create a card that slides when it is tapped on and then goes back to original position without tapping again the .onEnded() function of tap gesture

Invalid Swift Support / The SwiftSupport folder is empty

Environment: Xcode 7 GM I uploaded iOS app successfully using Xcode without error. This app is written in Objective-C and Swift. However, immediately after su

UIKeyboard issue in UITextfield and UITextview

I couldn’t able to enter space character in UITextview or UITextfield while tapping space from UIKeyboard. After multiple taps, a single space character w

Unable to activate constraint with anchors

So, I'm trying to create a sceneView programatically class ViewController: UIViewController, ARSCNViewDelegate { var sceneView: ARSCNView = ARSCNView()

How can I replace a ModelEntity in RealityKit?

I want to switch the ModelEntity from the fvBoatAnchor.fvBoatObject to the fvBridgeAnchor.fvBridgeObject with the click of a button, but I'm not sure how I do i

How to create CGImage from CVPixelBuffer?

I have a simple function to create CGImage from CVPixelBuffer: if let buffer = (results as? [VNPixelBufferObservation])?.first { let pixelBuffer = buffer.pi

Auto login using UserDefaults() not working Swift 5

I have followed some tutorials and used their methods to implement auto login for my app, but once I relaunch the app after entering the credentials, the app do

SwiftUI can not add onChange event

I have a view in which I display a list of my messages. Whenever a new message is added I want to scroll to the bottom. I am trying to add an onChange event to

SwiftUI - how to change text alignment of label in Toggle?

Code for Toggle in SwiftUI is this: Toggle(isOn: $vibrateOnRing) { Text("Vibrate on Ring") } This will produce a toggle button with text label looking like

Disable swipe back gesture in Swift

Been looking around on here for a while but can't seem to find a working solution. I'm trying to disable the swipe to go back to previous view gesture, in Swif

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 ?