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
194
questions
0
votes
0
answers
16
views
Lagging Video Feed Using VNGeneratePersonSegmentationRequest in macOS Camera Extension App
I'm developing a macOS application using Swift and a camera extension. I'm utilizing the Vision framework's VNGeneratePersonSegmentationRequest to apply a background blur effect. However, I'm ...
0
votes
0
answers
39
views
Custom Scroll View Indicator does not animate correctly
I created a custom scrollview indicator that can be dragged but it doesn't work completely right and it's not smooth. It has a few problems: Scroll End does not fire when the scroll view stops so the ...
1
vote
0
answers
27
views
Swift faster way to retrieve exif data from PHAsset
I'm working on a photos app on iOS, where I have to extract the camera information of user's photos for displaying.
The problem I am facing is that the process turns out to be extremely slow and ...
1
vote
1
answer
50
views
Update values in a dictionary based on changes made to another dictionary
I would like to know if there is a way to automatically update the value in a dictionary based on changes made to values in another dictionary.
I have 2 dictionaries as follows:
enum ...
1
vote
1
answer
44
views
Inheritance and Visibility in Swift
I'm confused about the content in the swift doc:
Notice that the initializer for the EquilateralTriangle class has three different steps:
Setting the value of properties that the subclass declares.
...
0
votes
1
answer
57
views
change in viewIndex should rerender the view but it does not [duplicate]
what am I missing? This change in viewIndex should trigger rerender of view but it does not.
ViewIndex will change the index of user to use for profileView and it will trigger rerendering.
import ...
-5
votes
2
answers
38
views
How to create a singleton class for amplitude?
I have the following amplitude code that initializes amplitude
import AmplitudeSwift
let amplitude = Amplitude(
configuration: Configuration(
apiKey: "YOUR-API-KEY"
)
)
...
0
votes
1
answer
31
views
How to generate SymmetricKey from password
I have the following code:
public extension SymmetricKey {
init?(base64Encoded base64EncodedKeyString: String) {
guard let keyData = Data(base64Encoded: base64EncodedKeyString) else { ...
1
vote
1
answer
51
views
Possible to have two different kinds of objects in a SwiftUI selectable List?
in a book club app I'm trying to write, I have a NavigationSplitView which displays a list of readers in a selectable List that gives the user access to each reader's comments on a given book. At the ...
-1
votes
0
answers
18
views
How to only allow users with accounts to login to my app [duplicate]
I am very new to iOS coding and using firebase so sorry if this is a dumb question.
I have an app that allows users to create accounts and save their info with firebase. A problem I face is that a ...
-2
votes
0
answers
14
views
Xcode NSHealthShareUsageDescription error
I keep getting this error but have updated my info.plist code. Help, please.
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'The string "" is an invalid ...
0
votes
0
answers
67
views
App very buggy when updating published properties
My apps data workflow is causing the UI to be very buggy when fetching more data which causes me to wonder the best practice for storing/displaying/fetching data, the setup I have works as follow:
The ...
-2
votes
1
answer
18
views
Xcode tests missing success/failure icons
I seem to have an odd bug in Xcode that I can't seem to fix. When I run tests, the tests seem to run (the console gives a report), but the test doesn't show the green success checkmark or red x ...
1
vote
0
answers
21
views
Setting Audio Input node for AVAudioEngine causes outside audio to stop
I'm building an app that will allow users to record voice notes. The functionality of all that is working great; I'm trying to now implement changes to the AudioSession to manage possible audio ...
-2
votes
1
answer
66
views
Escaped Double Quote in Swift breaking JSONDecoder decode
If you open a play ground and paste this code, you'll notice that the decoded object is nil. The JSON object [{"transcript":"A person might say, \"Hello\"."}] passes any ...