Category "swift"

Swift Package Manager BuildToolPlugin Network Access

I'm experimenting with the new BuildToolPlugin for Swift Package Manager. Evolution: https://github.com/apple/swift-evolution/blob/main/proposals/0303-swiftpm-e

Cancelling an async/await Network Request

I have a networking layer that currently uses completion handlers to deliver a result on the operation is complete. As I support a number of iOS versions, I ins

How to use Image Literal in Xcode 13

The most used feature is missing in Xcode 13 Image Literal #imageLiteral() these commands do not seem to be working. A similar change has happened for Color L

Quick Nimble ios test not running

I'm trying to use Quick & Nimble to test a project but the test is never executed. I've created a project from scratch using File->New->Project in Xco

How send an https request in swift with .crt and .key files

I'm developing an ios (ipad) application with swift. I'm able to send an http request with a URLSession object and it works well. Now I would like to know how s

SwiftUI calculate coordinate of the corner of UIimage

I'm looking to find the correct coordinate x,y of the 4 corners of the image display in the view. I wrote this code.. to calculate the first top left corner coo

SwiftUI Custom Picker Label Not Rendering

After updating to iOS 15 and Xcode 13, my picker in my app is no longer showing a custom label. Running the app on an iOS 14 device, the pickers render fine. Th

Vibrate after a button is clicked (x) amount of times

As the title says i am trying to trigger a vibration when the button is clicked x amount of times. For example when the button is clicked 3 times I want a vibra

SwiftUI List row color inconsistent while scrolling in a NavigationView

The background color of row views within a List inside a NavigationView inconsistently switch from transparent to white as I scroll.

"Image Literal" commands not working in Xcode

I started studying swift language n there is a command Image Literal to add an image but it's not showing up anything. other than that if I try any other coding

Xcode 13.3 Build Failed because of Cycle in Dependencies between targets libsignal-protocol-swift

After updating to Xcode 13.3 facing Build failed issues with libsignal-protocol-swift library. This is happening while building second time while after cleaning

Updating @Published var if a userdefault value is present swift

I am trying to check my app and see if a value exists in user defaults and if it does exist they will be taken into the app. If it doesnt exist they need to ent

Compositional layout with centred items and centred paging

Need some help here. I'm building an interesting layout, where cells are centered depending on their count. Probably, best thing to explain is to illustrate a l

UIButton position to right side of UITextView in a growing textView

I have a UIButton() in a textView. let expanButtonHeight = bounds.size.height expanButton.frame = CGRect(x: textView.bounds.size.width - expanButtonHeight,

Make different collapsable sections in tableView swift iOS

I want to implement the different expand/collapse section in tableView and each sections contain the different kind of data.I'm getting the index of section whe

How to grab the current users "firstname" from firebase store. Swift 5

I did more trial and error and a bit of online research and this is what I came back with: func presentWelcomeMessage() { //Get specific doc

UITabBarAppearance does not work on iOS15 iPad (title color)

I created a simple demo and only created a UITabBarController's subclass and set in storyboard. I want to set the TabBarButtonItem's title to an orange color wh

show masking on object which is between camera and wall using RealityKit

I made a video for generating a floor plan in which I need to capture the wall and floor together at a certain position if a user is too near to the wall or if

Is there a way to check if @Environmentobject exists swiftui

I have a view hierarchy where sometimes there is a chance that an @EnvironmentObject is not resolved. Is there a way to check if such @EnvironmentObject exists

Get coordinates in real time of a moving view in SwiftUI

I am moving a view called Point (which is basically a point), the point is moving in the screen every 2 seconds, and I need to update the coordinates in real ti