Category "swift"

swift "completion: @escaping" in kotlin language. How to use callback in kotlin?

I am looking for a way of completion block for my kotlin code. In Swift i have my function: func fetchRegister(with request: RegisterRequest, completion: @es

Xcode 11 beta swift ui preview not showing

Just playing with Swift UI basic app and the preview canvas is not showing even though I'm in canvas mode. App runs, and I have this little snippet what am I mi

How to change "Cancel" button text in modal sheet view in SwiftUI on watchOS 7?

I have 2 simple views: import SwiftUI struct ContentView: View { @State private var showingModalView = false var body: some View { Button(

UIApplication.shared.delegate equivalent for SceneDelegate xcode11?

I have defined a let property within my SceneDelegate. I would like some of the ViewControllers to be able to access that within the scene. In UIKit I could ac

Custom back button for NavigationView's navigation bar in SwiftUI

I want to add a custom navigation button that will look somewhat like this: Now, I've written a custom BackButton view for this. When applying that view as l

iOS SwiftUI: pop or dismiss view programmatically

I couldn't find any reference about any ways to make a pop or a dismiss programmatically of my presented view with SwiftUI. Seems to me that the only way is to

What is the difference between ObjectBinding and EnvironmentObject?

What is the purpose of @EnvironmentObject when we have @Binding property wrapper ? I am having trouble figuring out why @EnvironmentObject is needed. I took a l

Pull down to refresh data in SwiftUI

i have used simple listing of data using List. I would like to add pull down to refresh functionality but i am not sure which is the best possible approach. Pu

when i scroll down viewController shaking

Hello guys ,I have problem when i try scrolling down my viewcontroller shaking ,i couldn't find error.In other view controller haven't errors like this... How

Cleanest way to wrap array index?

Say I have an array of 5 Ints. What would be the most efficient way to wrap the index of the array if the index were incremented or decremented (for example) th

Issues while switching cameras during recording with AVFoundation

I am building a camera application similar to snapchat, and I need to be able to switch cameras while recording. I am able to switch cameras while NOT recording

CollectionView Disappears within StackView (Swift)

I'm trying to achieve the stackView arrangement shown in the middle of this figure:, but for some reason the top stack, containing a collectionView, disappears

How do I programmatically set secure text field and normal text field in swiftUI

SwiftUI has two different forms of text fields, one is SecureField which hides input and TextField which doesn't hide input. Instead of creating two separate vi

Open a FileDialog in SwiftUI on MacOs

In a SwiftUI app on MacOS I want to allow a users to select a file from the MacOS filesystem. I try to use AppKits NSOpenPanel . I tried like this, but I'm not

Arrange SCNNodes in Circle

I'm creating multiple nodes automatically and I want to arrange them around me, because at the moment I'm just increasing of 0.1 the current X location. capsu

iOS AppDelegate.m: Handling openUrl RCTLinkingManager and Twitter - Duplicate declaration of method 'application:openURL:options:'

I need to add DeepLinking to my React Native app, and as mentioned in docs I need to add the method above @and. // Add this above `@end`: - (BOOL)application:(U

Run code during app launch in SwiftUI 2.0

In my App struct, I have a small function that checks to see if the user has opened the app before. If not, it shows an onboarding view with a few questions. Ri

Unable to activate because they have no common ancestor IBOutlet and code

I am trying to add a constraint to a tableview I created and added to view programatically. I want to constraint it based on a UITextField which is an IBOutlet.

OUTDATED: Updating a UILabel to display current location

TLDR; I want to get locations outside the main thread using a different function but I am receiving delays. In details: I'm performing a GET request. later on I

Firebase/Firestore - database has insecure rules?

I have a SwiftUI application, which uses Firebase as a back end, and my rules are something like this: rules_version = '2'; service cloud.firestore { match /d