Subscribe to our monthly newsletter
Get exclusive Swift and SwiftUI tips, project updates, behind-the-scenes insights, and special discounts on our books — all in a monthly email from us.
Invalid email address
Unexpected server error
Subscribed!
Posts covering Swift language features and best practices
Build reusable, type-safe components for extracting and validating UUID values using Swift's RegexBuilder framework.
Learn how to add Codable conformance to Swift enums, including automatic synthesis, customizations, and fully manual implementations for complex cases.
Explore noncopyable types in Swift and learn how they enforce stricter ownership rules to avoid unintended errors and resource conflicts.
Learn how to resolve the issue of using lazy variables in @Observable classes by annotating them with @ObservationIgnored.
Use localizedStandardRange(of:) in Swift for flexible, locale-aware, case and accent-insensitive string searches, providing a user experience similar to system-wide searches.
Sorting arrays in Swift can be made more concise and readable by using comparison operators as closures in the sorted(by:) method.
This post explains how to use recursive enums in Swift, including the indirect keyword, to effectively model and manage complex, hierarchical data structures.
Efficiently count the number of elements in a sequence that satisfy the given condition with the new count(where:) method introduced in Swift 6.
When we need to compare arrays based on custom criteria in Swift, we can use elementsEqual(_:by:) method. It allows us to define custom comparison logic with a closure, offering more flexibility than using == operator.
Use convertFromSnakeCase in JSONDecoder to automatically map JSON snake case keys to Swift camel case properties, simplifying model definitions and ensuring naming consistency.
Swift's tuples are a convenient way to group multiple values, and their true utility shines with the language's built-in ability to compare tuples.
"Swift Gems" is a new book by Natalia Panferova for seasoned Swift developers. It offers over 100 tips and techniques to improve code efficiency and robustness, ideal for those looking to advance their Swift expertise.
Guide users through resolving issues and make your Swift applications more intuitive and supportive by defining user-friendly descriptions and recovery suggestions for custom errors.
Explore the practical applications and distinctions of self, Self, and Self.self in Swift, clarifying their roles in instance referencing, protocol conformance, and metatype access.
Discover how string comparison methods from Foundation outperform basic case conversion, ensuring precise, efficient, and culturally aware comparisons in our applications.
Define custom logic for matching different types of data in switch cases by overloading the Swift pattern matching operator (~=).
Property observers like willSet and didSet aren't triggered during initialization in Swift, but if we need to execute logic from property observers at this stage, we can use some workarounds.
Learn how to wrap withObservationTracking() into an AsyncStream to iterate over changes with an async for loop.
Monitor changes to specific properties of an observable class using withObservationTracking() function from Observation framework in iOS 17.
In Xcode 15 code completion we can view all the possible permutations of function parameters by pressing the right arrow key.
Swift 5.9 introduces the use of if/else statements as expressions, simplifying value returns, variable assignments, and enhancing code readability.
Discover the power of precise pattern matching with Swift enums as we look into using the where clause in switch statements and for-in loops, and adding extra conditions in while loops and if-case statements for more expressive code.
To sort an array based on a particular property in Swift, we can use the KeyPathComparator API from Foundation in combination with sorted(using:) method.
Make use of the new clock APIs in Swift 5.7 to delay an async task by a certain duration without calling the old method that accepts nanoseconds.
In Swift 5.7 that comes with Xcode 14 we can check if two values of type Any are equal, because we can cast values to any Equatable and use any Equatable as a parameter type.
Explore different ways to iterate over items and indices in a collection and learn why enumerated() is not a good fit for it.
Explore how to get around the Swift language limitation of not being able to define static mutable properties in generic types and protocol extensions.
Build a system for conforming polymorphic types to Codable protocol, that can be reused in multiple situations.
Customize encoding and decoding logic for individual fields of codable types in Swift by defining codable property wrappers.
Define your own operator that lets you use String as default value for any Optional type in debug prints.