Category "swift"

Xcode version 13.3.1: Update to recommended settings

I'm using the newest version of Xcode, version 13.3.1 (13E500a). Xcode currently shows a yellow warning sign Update to recommended settings. When I click on thi

Views at depth with root view - recursive?

I am trying to write a function to return all children of a view at a given depth : /// Write the body of the function `views(atDepth:withRootView:)` /// which

App works fine on device and simulator, but Apple review sends me this crash log

Here is the crash log Apple Review sent me. I've never had this issue previously, and it seems like the issue is coming from old code I've been using for months

Could not find module 'RxSwift'

I imported BitcoinKit.swift which worked fine but get now the error: Could not find module 'RxSwift' for target 'x86_64-apple-ios-simulator'; found: arm64, arm6

Where should I put my question mark in Swift?

I can see in the Apple documentation, when if let, the ? is used after as. But I tried this and the compile would not complain and the code behaved the same as

How to Add file .a to project by xcodegen swift

I want to add 5 file have extension .a to project. I click "+" button then choose 5 file .a add to project is success. But my project use xcodegen so I want to

Table View is empty when I switch Tab Bar controller screens

I have a Tab bar Controller to manage all the views. The problem I'm having is when I call a function in searchViewController (doAThing()) from HomeViewControll

NavigationLink is grayed out and does not perform any action [duplicate]

import SwiftUI struct ContentView: View { var body: some View { NavigationLink(destination: DetailView()) { Text(

Swift - Re-add time back into Timer

I have a countdown Timer that shows seconds and milliseconds. The user can start/stop recording multiple times until the timer hits zero. The user can also dele

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