All Questions
18 questions
1
vote
0
answers
25
views
Using a ViewModel in a simple SwiftUI screen with a list and API call
I'm building a SwiftUI screen that displays a list of notifications, using a ViewModel to handle state and API calls. The screen is fairly straightforward: it has a header and a paginated notification ...
1
vote
0
answers
41
views
SwiftUI NavigationSplitView three-column layout
For getting familiar with SwiftUI NavigationSplitView, I created a prototype, which implements a three-column view.
Screenshot:
Code (View):
...
1
vote
0
answers
60
views
SwiftUI: Handling number-inputs via TextField (actually String)
I'm creating a Settings-form in SwiftUI. One of the expected values is a double.
I tinkered with NumberFormatter, but it didn't work well for me.
Moreover I had to find a way making invalid values ...
4
votes
1
answer
218
views
SwiftUI TimeUnits-Converter App
The given task is to implement a time-units app.
I guess I got the main logic right, but concerning the UI-coding there could be improvements.
Here's my code:
...
3
votes
1
answer
60
views
Lists With Generic Data Types In SwiftUI
I've written a simple list in SwiftUI that accepts a generic data type.
The goal was to make a reusable list where when an item was selected, the list would execute a callback with the selected data.
...
4
votes
1
answer
699
views
Caesar Cipher in Swift (iOS-app)
I have implemented the Caesar Cipher in Swift and incorporated it into an iOS-app.
I guess it's formally correct. Please see the attached images, which show how the usage of the app is meant.
Here's ...
2
votes
1
answer
381
views
SwiftUI/Swift code for changing item values in an immutable struct
just wanted someone to review my code and perhaps simplify it a bit. Everything is working as expected for the moment but it seems too much code for what i'm trying to achieve. Especially the function ...
3
votes
1
answer
152
views
Structure and readability of the code in swift ios
For a job in company I had to do a code assignment. My assignment performs all the required tasks needed to be done. But after one month the company provided me a feedback and said that we have ...
-1
votes
1
answer
601
views
Use of parentheses in Swift [closed]
I am learning Swift and just had a quick question about use of parentheses. The code below runs just fine w/o using parentheses, but it certainly looks a lot cleaner using them in this instance.
So my ...
2
votes
0
answers
1k
views
SwiftUI custom ScrollView with snap interval
Due that fact that SwiftUI has poor ScrollView customization and doesn't support snap interval from the box I decided to implement my custom component to support ...
2
votes
0
answers
159
views
A Daily goals list 'Dopamine Box'
Inspired by Mike Boyd's 'Dopamine Box' video: link, I decided it would be a good project to pursue by myself in swift. The end goal is to make it look like the box in the video, with switches and a ...
2
votes
1
answer
561
views
Display a Text() with a foreground color based on a condition
I decided to write a simple tab bar for macOS using Swift.
tabs.swift
...
4
votes
0
answers
635
views
Navigation strategies for a SwiftUI-based app using MVVM pattern
I'm finding it difficult to decide on the best architectural pattern for a SwiftUI app but, for the moment, I'm sticking with MVVM as I found this a good fit conceptually.
I'm trying to avoid the ...
3
votes
1
answer
117
views
Break music player into usable components in SwiftUI
I created a music player using swiftUI.I need to ask a question when I break up my player into usable components. How should I take this approach with the music player? because the music player is one ...
3
votes
1
answer
3k
views
SwiftUI Dot indicator
I want to understand if I got this concept correctly.
I should start work from ViewState; a reference type object holding the state of a view. Here it is called <...