Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 1.05 KB

File metadata and controls

34 lines (22 loc) · 1.05 KB

DefaultEmptyPropertyWrapperSwiftCodable

Sample code demonstrating Build a @DefaultEmpty property wrapper that automatically defaults missing or null array fields to an empty array when decoding JSON in Swift..

This project accompanies the article: Creating a @DefaultEmpty Property Wrapper for Codable in Swift

Requirements

  • Xcode 26.2+
  • iOS 26.0+
  • macOS 26.0+
  • Swift 6.0

Getting Started

  1. Clone this repository
  2. Run xcodegen generate (requires XcodeGen)
  3. Open DefaultEmptyPropertyWrapperSwiftCodable.xcodeproj
  4. Build and run

What's Included

  • App.swift: Source file
  • DefaultEmpty.swift: Source file
  • User.swift: Source file
  • ContentView.swift: Source file

Learn More

Read the full article at BleepingSwift for detailed explanations and additional examples.

License

MIT License - see LICENSE for details.