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
334,915
questions
0
votes
0
answers
8
views
Autofill suggestions not showing up for QR-based verification code
I am trying to integrate autofill for a verification code in one of my iOS projects. I have added an apple-app-site-association file to my domain. It was integrated successfully, as now the iOS ...
0
votes
1
answer
30
views
Swift – Authenticate and simultaneously fetch user Id from Firebase
Very new to Swift and just following some tutorials
I have a loginViewViewModel with a function to login a user.
However, I also want to grab the uid from Firebase after .signIn and print to the ...
0
votes
1
answer
57
views
+300
Mac menu bar app crashing on app launch as notarized app only: failed to get text offset for /Applications/... (#3) No such process
I am developing a macos menu bar app, and for some reason, when I archive, notarize & export the app to my Applications folder and run the app, it crashes instantly. When I use the Console app, I ...
-1
votes
0
answers
28
views
How can I clear a Combine debounce when a trigger value is found? [closed]
How can I setup a Combine pipeline that will debounce all values except for a trigger value which will publish immediately and flush/clear any pending value in the debounce?
For a simple example case… ...
0
votes
2
answers
49
views
Parent view ignore safe area but child view respect safe area
I am building a custom full screen cover that can be dragged down with a gesture like the podcast app.
For the transition modifier with edge as bottom, it uses the bottom edge of the parent view thus ...
0
votes
0
answers
14
views
OSLog sometimes shows error instead of including string
Logger().fault("Example: \(myStr, privacy: .public)")
Why do I get the following instead of the contents of myStr sometimes? myStr looks fine in the debugger and not like this.
Example: <...
1
vote
1
answer
28
views
How can I mock an Objective-C class from Swift code for unit testing?
I'm trying to unit test a Swift class that depends on an Objective-C class. Call these SwiftClass and ObjcClass.
I created a protocol that contains the methods/properties of ObjcClass that SwiftClass ...
0
votes
0
answers
9
views
Limitations about Indexed Items for Spotlight with CSSearchableIndex and Performance?
Is there a limit for number of items (CSSearchableItem) in Core Spotlight CSSearchableIndex in iOS 9?
According to this topic, the number of indexes I can add is 32767.
Won't there be performance ...
0
votes
0
answers
24
views
Keyboard in swiftui is overlapping UI elements
Whenever i click in my textfield, the keyboard is overlapping my button, and i would like that the view would go up to have space between the button and keyboard
this is my code
import SwiftUI
@...
1
vote
1
answer
27
views
How can I identify and delete dead code in Xcode Swift
Is there a way to get Xcode to show a warning/error for unused functions and properties?
I have some dead dummy code left over from refactoring but no way to easily identify and delete it.
I'm in a ...
0
votes
5
answers
2k
views
How to display JSON data from API in TableView?
I recieves json data from api and totally confused what should I do next to pass this data to custom cell with imageView and labels in order to update UI in tableView.
Getting JSON
import Foundation
...
0
votes
0
answers
25
views
An iOS application crashed or was closed, how do know which screen was last viewed by the user?
An iOS application crashed or was closed by the user or closed because the device has no battery, how I retrieve the information for which screen was last viewed by the user?
I want to save this ...
1
vote
0
answers
11
views
Issue with Dequeuing Custom Cells in Main Storyboard
I'm encountering an NSInternalInconsistencyException when trying to dequeue custom cells designed in XIB files in my main storyboard. The error message is:
unable to dequeue a cell with identifier ...
0
votes
1
answer
40
views
SwiftUI Best ways to prevent onChange from executing until values have loaded
I'm trying to observe some state variables, of which are set/loaded when the entire view appears using .onAppear(). Problem is, this onChange is firing when the user loads the view without editing the ...
-1
votes
0
answers
15
views
How should SwiftUI accessibiltyActions be announced in VoiceOver?
I'm trying to add accessibilityActions to specific views in an app I'm working on for a client.
I'm using the accessibilityAction(named:) viewModifier. I can't share the client code, but it's ...