Category "swift"

Swift Array extension for standard deviation

I am frequently needing to calculate mean and standard deviation for numeric arrays. So I've written a small protocol and extensions for numeric types that seem

thin line on top of tab bar not removed in iOS 15

Tried using below code in iOS 15, but the thin line on top of tabbar is not removed but below code works in iOS 13, iOS 14 let appearance = UITabBarAppearance()

Swift Add Footer View In UITableView

This is actually a tableview and tableview cell, and i wanted to add a Submit button after the end of the tableview cell, but how do i do it? I tried to do it

Place multiple SCN objects in touchesBegan method

My Swift code below uses func touchesBegan to place a SCN object in the ARKit view. The problem is – it's only placing the object one time. I would like t

How to setup physical based rendering in SceneKit from code?

I want to present some scene with PBR. I created metalness and roughness textures and want to apply it to the mesh. When I try to do it in Xcode - everything is

Create secKey form data/hex/bytes using SecKeyCreateWithData give nil

I'm new to encryption. i want to create public seckey from data but i always get nil. Please help me. I need this public key as seckey to create a shared secret

Swiftui - Fetch data after login

I'm starting to learn SwiftUI and i'm looking for better solution to fetch user data after successful login. For example, i need to see if the user has the acco

Swift & Navigation : Navigation Bar changes its background color when scroll the view

I have 2 ViewControllers embedded in a Navigation Controller shown in the picture below. Every time I scroll through my table item, the navigation background c

Blank Map with Mapbox and SwiftUI

I try to use Mapbox with SwiftUI. I applied this answer https://stackoverflow.com/a/56551675/5653544 and also followed the mapbox tutorial. So I have a MapV

AppIcon is not displaying on SignIn with Apple login pop-up

This application is for iPhone only. This project is in flutter and AWS Cognito is used for social login. check this documentation AppIcon is not displaying in

Listen for documents just when actually added to collection - swift

I have a collection on Firestore and I listen for changes like this: func createMatchesListener(){ let db = Firestore.firestore() guard let current

didUpdateLocations never called

I'm trying to get the user's location. To do so I have set the following property in the info.plist : I have also added the following code in my viewDidLoad

convert milliseconds Integer into time formatted String

It might be an easy question but I am confused and need your help. I need to convert this: let S: Int = 45296789 into this: "12 34 56 789" that is to say

Why lazy.compactMap.first maps 'first' element twice?

I'm testing compactMap for lazy array to find first element and map it in a few lines of code. "abc5def".lazy .compactMap { print($0) return Int(Str

Reading Firebase Auth Error Thrown (Firebase 3.x and Swift)

I'm having trouble figuring out how to read the FIRAuthErrorNameKey in the new version of Firebase. The following is what I have so far, but the "let errorCode

Two almost identical targets in Vapor Xcode project

I want to configure Package.swift so that one target would be an extension to another, both of them should share the same code from the one folder, but for the

SwiftUI how to align the view‘s leading to the most super view’s leading?

I’m new to SwiftUI and I’m making a widget. The default code included a text view which is both x-centered and y-centered in the super view(which I

Toggle select / deselect state of a UICollectionView Cell on tap - Swift

So first of all i've been stuck on this for a few days and spent a full day reading and trying many options on Stack Overflow already but non to my success Wha

RealityKit – Text mesh resource performance warning

I have an object in RealityKit that I hover some text over. I make the text using the built in static function on MeshResource like this. let textMesh = MeshRes

How do you cache and retrieve swift packages using Azure Pipelines

I am trying to cache swift pacakages but I see a lot of examples doing the following below. This would only cache the package.resolved file but not necessarily