Category "swift"

Using user input in SwiftUI to perform calculations

I'm making a school project in which I have to find the weight of a person on different planets, but I am confused about how I should use the input and multiply

Trying to convert HTML to AttributedString within a UIViewRepresentable in SwiftUI

I'm trying to create this UIViewRepresentable view with an UILabel so that I can reprersent an NSAttributedString using SwiftUI. I've tried to create a functio

Firebase Analytics for iOS — custom parameters with predefined events (Swift)

I'm trying to implement Firebase Analytics for Swift iOS app. Could you please explain, if it's possible to pass custom parameters with predefined AnalyticsEve

self.image.frame.width = 20 give get only property error

i tried to change the width of my Image view to 20 @IBOutlet weak var image: UIImageView! using this code in viewDidLoad self.image.frame.width = 20 but it giv

Why UICollectionView didSelect method does not work?

I've created my UICollectionView programmatically and in this case my didSelectItemAtIndexPath method does not call at all. let collectionView = UICollectionVi

iOS Swift UI Test tap alert button

A really small UI test fails when trying to tap an alert button, what step am I missing? I'm trying to tap the "Continue" button in the alert displayed below w

Reality Composer and dealing with multiple surfaces

I want to know if there is a way for the scenes that gets exported from the reality composer to deal with multiple surfaces in the real world. So for example,

SwiftUI display gif image

The way to display animated gif image in swiftUI because of Image Image("fall-leaves") does not support gifs answer below

How can I apply a filters to ONE image?

I'm beginner in Swift and make an app "Photo Editor". I have a problem. I need to apply a some filters to ONE image. I have four sliders(sepia, contrast, bright

iOS-charts invert the X axis direction

I have a bar chart built using Daniel Gindi iOS-charts. It represents history data over a period of time. The issue I am having is that the data is being plott

How do I convert JSON with variable variable names into swift object?

I am working on a project with an API which gives me a JSON Object with some data in a variable. But the name of the variable under which the data is provided c

Clickable area of SwiftUI Picker overlapping

I am currently trying to create a page with three adjacent Picker views inside of an HStack as seen below: I made a CustomPicker view where I limit the frame t

SwiftUI strange behavior when moving items between sections in a List

so I've been trying to make a component using swiftUI that allows you to move items in a List between sections. I prepared an example with two sections: "First

Excluding files in Swift Packages

To exclude entire sections of a file, I can use macros to target platforms such as #if os(iOS) || os(watchOS). Is there a way to do this in Package.swift, or

Challenges with RealityKit and ARKit

I want to build a demo app in ARKit and I have some questions about what is currently possible with the beta (Apple has been calling this RealityKit, or ARKit 3

dispatch_once after the Swift 3 GCD API changes

What is the new syntax for dispatch_once in Swift after the changes made in language version 3? The old version was as follows. var token: dispatch_once_t = 0

What's the difference between ARAnchor and AnchorEntity?

I'm currently doing some experiments with RealityKit. I've been looking at some sample code, and I'm a bit confused about the differences between ARAnchor and

"No such module 'Firebase'" when add Firebase into a library

I just created new Framework and added Firebase via CocoaPods, when combine the library it success. But when I add that library to other project via CocoaPods

Access view file from UICollectionViewListCell

I have a question about the UICollection view list's separatorLayoutGuide. I saw this article and understood I need to override the function updateConstraints()

How to definitively set UITabBar background color and tint color

I have been trying to set my UITabBar's tint color and background color for quite some time now and nothing seems to work. So far I have tried: tabBarControll