Category "swift"

How to make a UILabel clickable?

I would like to make a UILabel clickable. I have tried this, but it doesn't work: class DetailViewController: UIViewController { @IBOutlet weak var tripD

Change alpha mask when texture changes on same SKSpriteNode

I have two functions that help me show different animations on my SKSpriteNode, but I need the alpha mask of this Sprite to change whenever the texture changes

Catch and call telephone number in WKWebView

I have a WKWebView that I want to ask to call a number when the number is selected. The contents of the web view contain the HTML anchor tag "tel:" and i am loo

There is a project that runs in the simulator without problems, but when installed on a device (iphone 7) crashes (when opened)

help, please, I need your help. There is a project that runs in the simulator without problems, but when installed on a device (iphone 7) crashes (when opened).

CircularBuffer error after upgrading to Xcode 13.3, SwiftNIO, Vapor in the mix

I have a project that will not compile, after upgrading to Xcode 13.3 The error is Type 'CircularBuffer<Element>' does not conform to protocol 'MutableCol

Swift - Adding a checkbox to every cell in the tableView

I've already made a table view which allows the user to add tasks to the table view, but now I need to add a checkbox in front of each task, so that the user ca

UITextView.attributedText, How to set numberOflines and lineBreakMode?

In some condition I have to use UITextView instead of UILabel(To make link attributes clickable). Here is my code: let attributedString = NSMutableAttribut

How does one use NavigationLink isActive binding when working with List in SwiftUI?

The use case is pretty simple. I have a List of places, and each corresponds to a geofence. I need to enable navigation in that particular row(s) whose geofence

typealias LazyVStack for iOS 13

I have a SwiftUI app that I want to maintain iOS 13 support for, but on iOS 14 I want to use the new LazyVStack and LazyHStack. I was thinking typealias would b

Why does RealityKit memory does not clear after deinit called?

I cannot manage to release my RealityKit ARView() from memory. I am aware that there were similar issues with ARKit + SceneKit with workarounds which doesn't so

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