Category "swift"

Make Custom SwiftLint action regex ignore comments

I have a custom SwiftLint action to flag up print() statements: custom_rules: disable_print: included: ".*\\.swift" name: "print usage" re

How do I stop physicsbody's from falling in SpriteKit?

I am making a game in Swift using spritekit and I want 2 objects on screen, one that I move with the touchesMoved function (player) and the other to stay still

Is it possible to create MKUserLocation programmatically?

I tried to do it this way, but this is wrong. let meMarkerDot = MKUserLocation() meMarkerDot.coordinate = location.coordinate //Cannot assign to property: 'coo

Force ViewController light mode but keep WKWebView mode adaptable

I'm using the newest version of Xcode for my iOS app. I'm stuck with one small task since hours: I want to force my View Controller to always stay in light mode

How to cache response in iOS and show only when internet is not available?

I want to cache the response of API. When the internet is available it should fetch data from the server and should update locally cached data every time and wh

Failed to log metrics

There is no Buildtime or runtime error on my code. however, when I run the code it says succeeded and a black screen comes up. I get the following on my console

Why is are the images being cut off?

The images in my 'tiles' are being cut off at the sides. I am trying to create a tile for each 'product' that displays an image, name and subtitle. Everything n

Trying to stop APNS custom sound from finishing playing

We are playing a custom when we deliver a push notification like so. { "aps" : { "alert" : { "body" : "User 1 started a Meeting",

overrideUserInterfaceStyle not working in AppDelegate

I'm building an iOS app with the newest version of Xcode. If I set overrideUserInterfaceStyle = .light to a View Controller, it will get set to light mode, als

best practice handling NSManagedObjects and CoreData in multiple VC's

i'd could use your advice on this one i restructured my whole app, to use coreData so i'd be able to save the Main Class of my app: "FooBar" i also transfered m

Implicit conversion loses integer precision after importing firebase package

I am getting 131 warnings of this type Implicit conversion loses integer precision... after I imported firebase packages to my Xcode project. The errors are poi

How to Connect to MySQL datbase using Swift-Nio

I used node js to connect mysql server and it is working good. I used the API developed in node js and used in the local macOS app. The problem is querying the

SwiftUI - Custom map pin's onTapGesture action is selecting a wrong pin view when there are group of pins in the save position(Zindex bug)

My map code is actually really simple: // // ContentView.swift // MapTest // // Created by Asi Givati on 24/04/2022. // import SwiftUI import MapKit import

Type 'AnchoringComponent.Target' has no member 'image'

I created an anchor entity this way and everything worked just fine at first private let imageAnchor = AnchorEntity(.image(group: "AR Resources",

SwiftUI App crashes after second continuous open

I have a working SwiftUI app with a start animation that appears to sometimes cause it to crash - this happens only when the user quits the app completely right

swift error: Value of type _ has no member _

how do I fix this error? xcodes-13 This Is my code for working with api: struct everything: Codable{ let topic: String let content: String

Find screen resolution in Swift [duplicate]

I am writing an iOS game in Swift using Spritekit and want to find the screen resolution to properly place my sprites. I found multiple ways o

macOS app crash on WKWebView() with EXC_BREAKPOINT on M1

Our app works properly when debugging on Intel machines but it crashes when we run on MacBook Pro with M1. App crash when we try to init WKWebView setUpWebView

I got this error in swift storyboard keyNotFound(CodingKeys(stringValue: "topic", intValue: nil), Swift.DecodingError

Error: keyNotFound(CodingKeys(stringValue: "topic", intValue: nil), Swift.DecodingError.Context(codingPath: [], debugDescription: "No value associated with key

extract image from stamp pdf annotation on PDFViewAnnotationHit notification

I want to know how I can extract image from Stamp Pdf annotation when PDFViewAnnotationHit notification triggered. We have pdf notification when we touch pdf an