CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 13:22:53 GMT
content-type: text/html; charset=utf-8
content-encoding: gzip
cf-ray: 965c72b89d51c1b5-BLR
cf-cache-status: DYNAMIC
cache-control: private
set-cookie: prov=7172c49d-fc17-460c-839a-96d714b1bfaa; expires=Mon, 27 Jul 2026 13:22:53 GMT; domain=.stackexchange.com; path=/; secure; httponly
set-cookie: prov=7172c49d-fc17-460c-839a-96d714b1bfaa; Path=/; HttpOnly; Domain=stackexchange.com
set-cookie: __cf_bm=XXo.OiK4DroOevYs6djtI6qOZCkH.EkKs8IWJbztIRs-1753622573-1.0.1.1-aMO.zq8c1wfgkkC0_p6hcKMxOSWjNriwPh.IxCEDGpaDN9nj_Shgg3MerTdFRpy.qNfZVPkteghddyzr0HFnEJdUZo52IsaijTYDeDwMI80; path=/; expires=Sun, 27-Jul-25 13:52:53 GMT; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
set-cookie: _cfuvid=r0Trnv6OPMPdV8mfcFOSyUJJ0LI.fAQ90nlKLGAjbxo-1753622573392-0.0.1.1-604800000; path=/; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
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: 604bfa7c-12b8-4a3b-a669-4ff9016badaa
x-worker-origin-response-time: 486000000
x-dns-prefetch-control: off
server: cloudflare
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
250
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
- Rec Letter from Professor (who I haven't done research with) or from Work Supervisor
- How to navigate in the Universe's Heat Death
- Can Spi flash memory's contents be corrupted from heat?
- Meaning of 芭蕉 in Tang age
- What is the weight of holy water?
- About Harp Pedaling for a Pentatonic Glissando
- When did the OEIS get even better?
- Not your ordinary affix riddle
- Is there any verse which says that throughout the Vedas the praise of Shiva is sung?
- Why is 0.0 printed as 0.00001 when rounding upward?
- What Isp can be gotten from a napthalene (mothball) hot gas thruster? Did it work in space?
- Moving multiplying cells away
- Regenerative cooling of rocket engine turbine's blades
- Will a reinforced 1" concrete slab be durable?
- Forces applied to a car hood while driving
- How can I turn the text in a PNG file back into text layer?
- How to change opamp variable resistor to fixed resistor?
- Can a minor run a business by having an adult act on their behalf?
- Humans on alien planet get tailed by silent humanoids
- How many simple groups are there of a given infinite cardinality?
- The Russian president is struggling to pass a law now. Then, how much power does Kremlin have to initiate a congressional decision?
- “Unclear step in a math book for entertainment”
- Extensions of diagonalizable, respectively multiplicative-type, groups
- Can expanding foam provide interior strength for a large model?