CARVIEW |
Select Language
HTTP/2 200
date: Sat, 26 Jul 2025 08:41:46 GMT
content-type: text/html; charset=utf-8
cf-ray: 9652998b1e83e9c3-BLR
cf-cache-status: DYNAMIC
cache-control: private
set-cookie: prov=5ad0d1d8-ee1d-43dd-86fc-f1e9c53f8555; expires=Sun, 26 Jul 2026 08:41:45 GMT; domain=.stackexchange.com; path=/; secure; httponly
strict-transport-security: max-age=31536000; includeSubDomains
vary: Accept-Encoding
content-security-policy: upgrade-insecure-requests; frame-ancestors 'self' https://stackexchange.com
x-clacks-overhead: GNU Terry Pratchett
x-frame-options: SAMEORIGIN
x-request-guid: 0360d715-80c3-4f24-8aff-3395eb5f7b7f
x-worker-origin-response-time: 599000000
x-dns-prefetch-control: off
set-cookie: prov=5ad0d1d8-ee1d-43dd-86fc-f1e9c53f8555; Path=/; HttpOnly; Domain=stackexchange.com
set-cookie: __cf_bm=aJECj1CNDfVlN.NaW_82D83JyFpnQA20F654Mh53OKg-1753519306-1.0.1.1-dzyhnaWwuOzVvPs3b4a_c3QqATgo649dIOWlsNMx4Tfv9wextOsOjkXdaV0G9FVxT54AaJJwz0EHCJjfk9deyM8kHwG_MRjdEveb_DExUwk; path=/; expires=Sat, 26-Jul-25 09:11:46 GMT; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
set-cookie: _cfuvid=TnC4d3CQEXQjLGrRkbNxdJK7q0eUIOgyBlGDsOr8slU-1753519306066-0.0.1.1-604800000; path=/; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
server: cloudflare
content-encoding: gzip
Newest 'swift' Questions - Code Review Stack Exchange
Skip to main content
Stack Exchange Network
Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack ExchangeTeams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about TeamsQuestions tagged [swift]
Swift is a general-purpose, multi-paradigm, compiled programming language developed by Apple Inc. for iOS, iPadOS, macOS, watchOS, tvOS, Linux, and z/OS.
659 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
5
votes
4
answers
249
views
Swift for CLI tools (traversing directories, reading text files)
To compare ergonomics and performance of some languages for my hobby projects, I have written a simple lines of code counter in Swift, Go, Rust and Python. It scans a given directory tree for source ...
user292421
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 ...
4
votes
3
answers
360
views
Swift - Process file with key-value pairs
I got to process a simple text-file, which contains key-value pairs. Key-value shall be separated by a tabulator.
Here's the prototype, which I figured out:
...
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):
...
0
votes
0
answers
36
views
Class to make UserDefaults get/set easier in Swift
I created the following class to ease UserDefaults get/set within my Swift project.
...
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 ...
6
votes
1
answer
203
views
Showing an audio waveform from sample audio data with user interaction for zoom in/out
I want to show an interactive audio waveform like this.
I've extracted the sample data using AVAssetReader. Using this data, I'm drawing a UIBezierPath in a Scrollview's contentView. Currently, when I ...
4
votes
1
answer
102
views
Swift Arrays: Write a rotate-right function
Task:
Write a function which rotates all elements of a given array to the right.
Example: [1, 2, 3] => [3, 1, 2]
My solution:
...
4
votes
2
answers
175
views
Swift String-extension 'countOccurrencesOfChar'
Loosely inspired by Ruby's String.count-method I wrote a similar Swift-method myself as an extension to the String-class. Then I had the idea to use a second parameter with which you can control if ...
2
votes
1
answer
97
views
Swift: 'Working with double-optionals'-exercise
Task: Write a function, which receives an optional array of optional integers and returns a none-optional integer. In case the array isn't nil: Return one randomly selected integer. In case the array ...
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
Swift: Mocking a REST API-request
I have read the last two days through several tutorials about how to mock a HTTP-request against a REST API.
Finally I made a prototype for applying, what I have understood from the tutorials.
Here's ...
3
votes
2
answers
377
views
Write a Swift-function, which computes the Digital Root
Task: Write a function, which computes the Digital Root of a given number n.
Here's the solution, which I developed:
...
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.
...
2
votes
1
answer
90
views
Show a list of downloads
I've been working on a Swift project that involves a seedbox app for my NAS, and I would appreciate some feedback on the code structure and especially on the placement of my observer. I've implemented ...
- The Overflow Blog
-
-
- Featured on Meta
-
-
Related Tags
ios × 215
performance × 53
swift3 × 43
beginner × 38
strings × 30
algorithm × 29
array × 28
object-oriented × 23
json × 21
uikit × 21
generics × 20
cocoa × 19
swiftui × 18
design-patterns × 15
comparative-review × 14
protocols × 14
extension-methods × 13
mvc × 13
time-limit-exceeded × 13
image × 12
primes × 12
core-data × 11
calculator × 11
more related tags
Hot Network Questions
- Current integrator LTSpice simulation
- Meaning of 芭蕉 in Tang age
- Lay explaination of 'lower evolutionary constraint genes'?
- Did Denmark report that 64% Palestinian refugees from 1992 received serious fines or jail time?
- Are birth control pills classified as a carcinogenic at the same level as asbestos and tobacco?
- In Jurassic Park, is the lysine dependency intentionally fake (in-universe)?
- Automatic drawing of polygon around selected polygons in QGIS
- Siding listed in IRC - what are “Wood Rustic, Drop”, and “Butt Tip”?
- Is the surface of Mars or the Moon mostly (or relatively) homogeneous, unlike the Earth?
- Is it okay to email researchers if I’m just a high school student?
- How do I create a Chrome profile via the command line that also shows up in the profile switcher?
- Anonymizing a submission for double-blind review
- Does Philosophy Need Quotes?
- Why is this delayed differential system giving errors in plotting the solution?
- Moving multiplying cells away
- Not being introduced to the team – should I ask for it?
- Why is 0.0 printed as 0.00001 when rounding upward?
- Are classified documents subject to a subpoena in discovery?
- When and why is fwait necessary when using the 8087 coprocessor?
- Can one engage with physics (or science) without touching philosophy?
- Does SZNUD3160 really eliminate the need for diode?
- Source that Eliyahu Hanavi was an angel at the creation
- The pea and the sun paradox
- Word order for a phrase with a number, adjective and noun