Quantcast
Channel: Swift by Sundell
Browsing index pages (107 articles)
↧

Building a design system at Genius Scan

As an app’s code base grows and evolves, it can be really tricky to maintain consistency within its UI. It’s easy for things like margins and padding, or colors and fonts, to start diverging, as...

View Article


Deciding between ‘let’ and ‘var’ for Swift struct properties

When declaring a Swift property, we use either the let or var keyword depending on whether we want our new property to be read-only once assigned through the enclosing type’s initializer, or whether we...

View Article


Decoding Swift types that require additional data

Swift’s Codable API — which consists of the Encodable protocol for encoding, and Decodable for decoding — offers a powerful, built-in mechanism for converting native Swift types to and from a...

View Article

Tips and tricks for when using SwiftUI’s ViewBuilder

SwiftUI’s ViewBuilder type is a key part of the library’s overall API design, in that it’s what enables multiple view expressions to be declared within a given scope (such as a body property...

View Article

Using Swift’s defer keyword within async and throwing contexts

Swift’s defer keyword allows us to delay the execution of a given block of code until the current scope is exited. While that might initially not seem that useful (after all, can’t we simply write that...

View Article


Modern URL construction in Swift

These days, most applications need to work with URLs in some form. Perhaps they’re used to make network calls, to read and write files, or to perform various kinds of database operations. In Swift,...

View Article

Swift by Sundell is back!

I never actually decided to stop writing Swift articles. It just sort of happened. In fact, for the past two years as this website has been very much dormant, I’ve lost count of the number of times...

View Article

SwiftUI views versus modifiers

One of the most interesting aspects of SwiftUI, at least from an architectural perspective, is how it essentially treats views as data. After all, a SwiftUI view isn’t a direct representation of the...

View Article


Observing the content offset of a SwiftUI ScrollView

When building various kinds of scrollable UIs, it’s very common to want to observe the current scroll position (or content offset, as UIScrollView calls it) in order to trigger layout changes, load...

View Article


Podcast: “The evolution of Swift”, with special guest Nick Lockwood

On this final episode of 2022, Nick Lockwood returns to the show to discuss the overall evolution of Swift and its ecosystem of tools and libraries. How has Swift changed since its original...

View Article

Podcast: “Swift concurrency in practice”, with special guest Ben Scheirman

Ben Scheirman returns to the show to discuss how Swift’s built-in concurrency features, such as async/await and tasks, can be used in practice when building apps for Apple’s platforms.SponsorsEssential...

View Article

Combining opaque return types with primary associated types

Ever since Swift was first introduced, it’s been very common to need to use type erasure when working with generic protocols — ones that either reference Self within their requirements, or make use of...

View Article

Podcast: “Responsive and smooth UIs”, with special guest Adam Bell

Adam Bell returns to the podcast to discuss different techniques and approaches for optimizing UI code, and how to utilize tools like animations in order to build iOS apps that feel fast and...

View Article


Podcast: “Freelancing and WWDC22 highlights”, with special guest Donny Wals

Donny Wals returns to the show to talk about being an iOS developer freelancer, and to discuss some of the key new APIs, Swift language features, and frameworks that were introduced at...

View Article

Podcast: “The role of system design”, with special guest Gui Rambo

Gui Rambo returns to the show to talk about the role and importance of system design when building apps and open source tools, and how common app architectures and design patterns can be augmented with...

View Article


Sponsored: Essential Developer

Thanks a lot to Caio and Mike, the two developers behind Essential Developer, for sponsoring Swift by Sundell. Essential Developer was founded to help iOS developers accelerate their journeys towards...

View Article

Podcast: “What’s new in SwiftUI in iOS 16?”, with special guest Natalia...

Natalia Panferova joins John to discuss some of the key new features that are coming to SwiftUI and UIKit in iOS 16, and to talk about her experience working on SwiftUI at Apple.SponsorsNordVPN: Get an...

View Article


Switching between SwiftUI’s HStack and VStack

SwiftUI’s various stacks are some of the framework’s most fundamental layout tools, and enable us to define groups of views that are aligned either horizontally, vertically, or stacked in terms of...

View Article

Podcast: “Swift 5.7, generics, and the road to Swift 6”, with special guest...

Ben Cohen, manager of the Swift team at Apple, joins John on this WWDC22 special to discuss Swift 5.7, how generics have been made more powerful and easy to use, and how the language is expected to...

View Article

Using the ‘some’ and ‘any’ keywords to reference generic protocols in Swift 5.7

Combining Swift’s flexible generics system with protocol-oriented programming can often lead to some really powerful implementations, all while minimizing code duplication and enabling us to establish...

View Article
Browsing index pages (107 articles)


Latest Images