18,423 questions
1
vote
1
answer
50
views
Does Swift allow passing argument based on control flow like if else?
I am trying to if else condition when passing argument.
getLocation(with:
if #available(iOS 14.0, *) {
coreLocation.authorizationStatus
} else {
...
0
votes
0
answers
35
views
Not able to use TranslationSession directly inside a static function of Swift
I have a static function in swift with input string as paramter. i want to translate it to spanish using Mac Translate WWDC api. I am not able to initalize TranslationSession inside it. Is there ...
0
votes
0
answers
103
views
Not getting callback in userContentController in iOS Swift?
There is a click button on my webpage, but I am not getting the click button callback from the webview in userContentController. The javascript is already implemented on the web end.
I have tried to ...
1
vote
0
answers
41
views
How to add PitchTap and FFTTap simultaneously to a mic input in Audiokit 5
I am trying to set up both an FFTTap and a PitchTap to an audioEngine along with an oscillator in a Swift SpriteKit game. The aim is to process both pitch and amplitude of mic input via PitchTap and ...
1
vote
0
answers
109
views
Prevent NavigationLink to go back by itself to Navigation View
I have a list of restaurants that its observed all the time:
func getAllRestaurantsInParameters(lat: Double, long: Double){
self.repo.getAllRestaurants().watch(block: {restaurants in
...
0
votes
0
answers
121
views
Error: With Swift ViewModifier using NavigationLink: Generic parameter could not be inferred
I'm encountering an issue with a custom Swift ViewModifier that utilizes a NavigationLink. The ViewModifier, named LinkTo, aims to conditionally present a view using NavigationLink based on a binding ...
0
votes
1
answer
109
views
Why is the Navigation Title and Picker View is scrolling without it being inside a Scroll View?
Sorry for the weird title, I'm not sure how to explain it properly.
I'm facing an issue where the Navigation Title and Picker View is scrolling with the content, even though it is not inside the ...
2
votes
3
answers
1k
views
How to trigger onAppear when returning from fullScreenCover
onAppear doesn't trigger
struct ProfileView: View {
@StateObject var viewModel = ProfileViewViewModel()
var body: some View {
NavigationView {
VStack {
if ...
0
votes
1
answer
545
views
SwiftUI - WebView
fairly new to SwiftUI, so thank you in advance. Inside the init of the Coordinator we pass the WebView to let the Coordinator know who the parent is, but the WebView being a struct, wouldn't ...
1
vote
1
answer
49
views
Error while trying to scan a document using a scanner device in macOS in the Swift/SwiftUI App
I was wondering if there are any guidelines or examples for scanning documents with a scanner using Swift in a SwiftUI app. Scanning failed with the following error message:
Scanner Device has not yet ...
1
vote
1
answer
130
views
In SwiftUI on MacOS Detect Clicks and Doubleclicks in List
I have a List with a few lines.
The Lines contain two clickable Images and some text.
Clicking or Double-Clicking the Images shall trigger an action.
Clicking anywhere else in the Line shall select ...
0
votes
0
answers
244
views
fullScreenCover dissmissed after swipe of tabView | SwiftUI | iOS
My application has a splash screen with the following code,
It redirects to ApplicationSwitcher()
HStack {
Spacer()
VStack(alignment: .center) {
Spacer()
// Text("Value: \(vm.isNavigating ...
0
votes
1
answer
37
views
How to use extern Structure in a View correctly?
I couldn't find a way to use my Structure in a ContentView.
Structure fills correctly, but that's it.
How can I replace example array in a View:
let countries = ["Germany", "Egypt",...
1
vote
0
answers
100
views
Navigation Bar Not Showing Up SwiftUI
In my Main.storyboard, it shows the "< Home" back arrow button for three of the scenes, but when I actually run the app, I do not see the back buttons. Why is that? Is there a problem ...
0
votes
1
answer
220
views
Text modifiers in Data
I've created a data-model in SwiftUI
import Foundation
struct BLSectionModel : Identifiable {
var descriptionTop : String
}
The data looks as follows:
import Foundation
import SwiftUI
let ...