Error Handling in Swift: From Basics to Typed Throws
A practical guide to Swift error handling covering throw/try/catch fundamentals, custom error types, Result, async error patterns, and typed throws introduced in Swift 6.
// 5 articles available
A practical guide to Swift error handling covering throw/try/catch fundamentals, custom error types, Result, async error patterns, and typed throws introduced in Swift 6.
NSError is the standard error handling mechanism in Objective-C, but using it defensively requires more than just passing a pointer. Learn patterns that prevent crashes and make debugging easier.
Both let you add methods to classes, but categories and class extensions serve different purposes. Here's when to use each.
Objective-C lacks namespaces, so the community invented conventions. Here's how prefixes and other patterns help avoid collisions in a flat symbol space.
Objective-C supports exception handling with @try/@catch, but the community settled on NSError pointers instead. Here's why.