Questions tagged [swift]
Swift is a general-purpose programming language developed by Apple Inc first released in 2014 for its platforms and Linux. Swift is open-source. Use the tag only for questions about language features or requiring code in Swift. Use the tags [ios], [ipados], [macos], [watch-os], [tvos], [swiftui], [cocoa-touch], and [cocoa] for (language-agnostic) questions about the platforms or frameworks.
swift
202
questions
0
votes
0
answers
9
views
How to make it so a DatePickers Date cannot come before another DatePickers date in swiftUI
I have two pickers for startTime and EndTime that default to Date.now but currently the user can make the endTime come before the start time, how do you prevent this?
@State private var workoutName: ...
0
votes
0
answers
5
views
AccessibilityValue not displaying for SwiftUI Menu items
I've got the following code that displays a simple Menu and another Menu with submenu. While the accessibilityIdentifier shows up in the accessibility inspector tool for the menu items, the ...
0
votes
0
answers
12
views
fetchCount works but fetch doesn't
I am writing a function in my database object that can read from the database.
I am storing vocab objects
@Model
final class Vocab: Codable{
var id: Int
var word: String
var meaning: ...
0
votes
0
answers
5
views
Swift Efficiently Draw Image and Text on PixelBuffer
I am trying to record a video from the camera, through AVCapture and AVAssetWriter, and to overlay some text and an image on the final video but I cannot achieve good performance and the device ...
0
votes
0
answers
10
views
CapacitorJS: is it possible to share local data between iOS widget and Preferences API?
I am using a widget in my capacitor app (currently this question only focuses on iOS).
I want to save an integer from my webview code into Preferences and then be able to read it from the iOS widget.
...
0
votes
2
answers
24
views
Unable to create file in specified directory because of security scope resource errors in iOS app
Goal: A user selects a folder in Files app where they would create files in that folder. This is an iOS app. This folder path is saved in the iOS app, using this app user would create file ...
0
votes
0
answers
29
views
Every time I call keyboard, keyboardWillShowNotification is called twice
I am using swiftUI. And I used NotificationCenter to move textfield when keyboard appears by using keyboardWillShowNotification and keyboardWillHideNotification. But every time I touch textfield and ...
-2
votes
1
answer
15
views
Unexpected Behaviour from PHPickerFilter in SwiftUI
I am trying to filter out live photos and videos however. This filter does not work:
I am trying to filter out live photos and videos. However, I am getting some unexpected results. Doing the ...
0
votes
0
answers
23
views
How to change TurpleView<_VariadicView.Children> to Custom View?
Several Views were received as 'TurpleView<_VariadicView.Children>'.
struct View1: View {
var body: some View {
VStack {
Text("page!")
}
}
}
struct ...
-3
votes
0
answers
21
views
Strange icon on UItextField iOS Swift
Image I am getting a strange icon shown in the picture on top of the UITextField in iOS Swift. I would greatly appreciate any help.
One more thing I am using UIFloatLabelTextField.
Regards,
There is ...
0
votes
0
answers
14
views
in UIKit, the UIButton is untappable (due to Swift UIKit constraints?)
This is the code in my custom cell:
gb = UIButton()
gb.setImage(UIImage(named: "skejt_zelena_polutka"), for: .normal)
gb.addTarget(self, action: #selector(...
0
votes
1
answer
9
views
Swift UIKit ordering and positioning with constraints inside a custom table cell [duplicate]
I have a custom table cell, and all I want to do is insert two button images inside it. This is my code:
gb = UIButton()
gb.setImage(UIImage(named: "skejt_zelena_polutka"), for: .normal)
gb....
-3
votes
1
answer
18
views
How to Structure a Firebase Database and Query Documents from District in Swift? [closed]
I am developing an app using SwiftUI and Swift. I have a Firebase database with the following structure:
Collection named products,
Documents representing countries,
Subcollections representing ...
0
votes
0
answers
20
views
Image recognition CoreMl + SwiftUi.... Issue with view
I'm experiencing an issue with my SwiftUI project that uses Firebase and a CoreML model for image recognition. Despite adding various debug print statements, the process doesn't proceed beyond the ...
0
votes
1
answer
27
views
How to pad a button to fit its view in a SwiftUI form
I have a page in swift like below.
import Foundation
import SwiftUI
struct SomeViewName: View {
@State private var languages = [String]()
var body: some View {
NavigationView {
...