Category "swift"

listening for multitouch events in OS X using the touchesBegan and touchesMoved event handlers

I am trying to record touches and finger movements that users perform on a 2018 MacBook Trackpad. When I try to test the API and print to console when the user

iOS Swift Combine: cancel a Set<AnyCancellable>

If I have stored a cancellable set into a ViewController: private var bag = Set<AnyCancellable>() Which contains multiple subscription. 1 - Should I canc

How do I read a User's Firestore Map to a Swift Dictionary?

I have my user struct with has a dictionary of all their social medias. struct User: Identifiable { var id: String { uid } let uid, email, name, bio, profileI

How to give shadow with cornerRadius to a Button in SwiftUI

I'm trying to give a shadow to Button using following code. Code: Button(action: { }) { Text("SIGN IN") .fon

How to know that horizontal collectionView section did end decelerating?

I have a vertically scrolling collectionView where sections are scroll horizontally. How to know that section did end decelerating? If I use func scrollViewDidE

SwiftUI Calling functions from other class

I am having a little trouble here: I have a class class TempC { func GetData(){ //do stuff } } And in ContentView I want to call the func

Build error of react native run iOS on M1 Macbook

I initialized new react-native project with "react-native init ReactNStudy" for first time on my M1 Silicon Apple computer. Metro builder worked without any pro

Open a ViewController if a cell of a TableViewController is clicked

i'm trying to create a view controller programmatically that will be opened if a cell on a table is clicked. i'm using a table view and i'm filling it with a xi

Execute code when UIView has been visible for a specified time

In an iOS app (using UIKit), a specific action should be performed when a UIView has been "seen" by the user for at least 30 seconds. A generic approach or an e

CoreData .FileExporter creates endless local backup of sqlite file on MacOS

I want to create a local backup of the CoreData sqlite file, and then have the user choose the save location with a popup. I've attached the following fileExpor

Difference between CurrentValueSubject and @Published

So I'm digging into combine and this question came up. Is there any real difference between using CurrentValueSubject (and setting its value using currentValue

Inheritance from non-protocol type 'UICollectionViewFlowLayout'

I have a horizontal collection view in my project which has 2 elements - a button and a label. Button and label are stuck to each other and then I want to show

How to implement localization in Swift UI

Can anybody help me? I can't find any description of the localization in Swift UI. Can anyone please give advice or better an example of how to localize for exa

Can't reset UILabel attributedText when a UITableViewCell is reused

The problem I'm using a UITableView to show the list of transactions of a credit card. If the transaction is a chargeback, I'm adding a strikethrough style to

How to use UIAccessibility.post(notification: .layoutChanged, argument: nil) in SwiftUI to move focus to specific view

I have one button on screen and on that button tap it opens one modal (view). but after closing that view, the focus of accessibility voice over goes on top of

SwiftUI - create a single dashed line with SwiftUI

I need to create a single dashed line. I tried going about it by creating a Rectangle view with a dashed stroke. However, when setting the height of the rectang

Failed to load module 'project name'

I added unit test target to my existing project, but while @testable import Product_Module_Name getting error "Failed to load module 'Product_Module_Name'". I

Missing required module 'Firebase' for Unit test

i added Unit test target to existing project, when i @testable import Product_Module_Name in test class i am getting Missing required module 'Firebase' i am u

Repeating animation on SwiftUI Image

Given the following struct: struct PeopleList : View { @State var angle: Double = 0.0 @State var isAnimating = true var foreverAnimation: Animatio

AudioKit Cookbook v.5 build fails (xcode 13.2.1)

I have been trying to build, to no avail, the Cookbook under Xcode 13.2.1. I get "Analyze Failed" with the following errors: Stk: Command CompileSwiftSources fa