Category "swift"

SwiftUI - How to pass EnvironmentObject into View Model?

I'm looking to create an EnvironmentObject that can be accessed by the View Model (not just the view). The Environment object tracks the application session da

NSOpenPanel malfunctioning

I have an app that needs to have a "choose file" function and I used a button hooked up to a function using NSOpenPanel to do that. But after I tried to add a d

Swiftui - How do I initialize an observedObject using an environmentobject as a parameter?

I'm not sure if this is an antipattern in this brave new SwiftUI world we live in, but essentially I have an @EnvironmentObject with some basic user information

Mutable Binding in SwiftUI Live Preview

I have a ChildView with a variable: @Binding var itemName: String In this ChildView I have few buttons that change value of the variable: Button(action: {

WCSession counterpart app not installed or installed throughout settings in the watch app

I have developed my watch app for my iOS App. The problem is that I need to use WCSession logic in order to send data from iOS to the AppWatch and vice versa. I

Function opaque return type was inferred as ... which defines the opaque type in terms of itself

Xcode gives the error: Function opaque return type was inferred as 'Button', which defines the opaque type in terms of itself on the line below: @State var sh

Mimic the iOS Photos APP browsing behavior with SwiftUI

I am new to SwiftUI (iOS development). I would like to mimic the iOS Photos APP browsing behavior with SwiftUI. More specifically, I want to display a photo in

Can I change the Weekday format to be like (Su, Mo, Tu, We, Th, Fr, Sa) in FSCalendar

I want to change the current week title to two letters, eg: sun to su, mon to mo, in FSCalendar.

Add dependency on a local swift package in Xcode 11

I am trying to add a dependency on a local swift package in my Xcode project. (I don't want to add a dependency using a file url file://me/dev/app/package as th

SceneKit- Cannot query using bitmask

We were able to have custom raycasting using bitmasks: let hitTest = sceneView.hitTest(location, options: [categoryBitMask: bitmask]) But hitTest is deprecated

Back4App create user using authenticated permission for PFUser class

As administrator I want to create another users from the iOS app. In my system I would like users to be created via my admin panel. I have switched public permi

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