Toby O'ConnellSwift enums and the danger of the default caseHow not to lay traps for future developers2 min read·Feb 15, 2024----
Toby O'ConnellinCodeXWhy structs are better than protocols for dependency inversionHow we use structs instead of protocols to reduce verbosity and complexity whilst maintaining testability3 min read·Sep 19, 2022--7--7
Toby O'ConnellinCodeXThe importance of logical data modellingHow we can use enums instead structs to prevent crashes and simplify code2 min read·Apr 12, 2022--1--1
Toby O'ConnellinCodeXFun with Natural Language ProcessingHow you can use Apple’s Natural Language framework to spell check and more!2 min read·Apr 10, 2022----
Toby O'ConnellinCodeXSwift + C: Callback InteroperabilitySolving the context capture issues in @convention(c) closures3 min read·Oct 22, 2021--1--1
Toby O'ConnellTuple splatting in SwiftHow Tuple Splatting can make higher order functions more concise, plus a bonus helper function to use on single elements!2 min read·Aug 28, 2021----
Toby O'ConnellinCodeXEnums Cases as Protocol Witnesses and the Open-Closed PrincipleHow can enum cases can be used to satisfy protocol requirements & deciding if they’re the best choice for API ergonomics.2 min read·Jul 24, 2021----
Toby O'ConnellinCodeXEncoding awkward types with minimal boilerplate using `withUnsafeBytes`History2 min read·Mar 26, 2021----
Toby O'ConnellinCodeXUsing tuples for Comparable and Equatable conformanceRecently I discovered that tuples can be used to easily and simply compare and equate multiple variables.1 min read·Mar 20, 2021----
Toby O'ConnellinCodeXUIGestureRecognizer with closuresOne of the biggest downsides to UIGestureRecognizer is the inability to attach simple closures in-line. To use them, a target object must…1 min read·Mar 7, 2021----