You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -729,6 +729,25 @@ struct Settings {
729
729
}
730
730
```
731
731
732
+
#### AutoFlexibleType Trait (Swift 6.1+)
733
+
734
+
If you prefer all types automatically support flexible type conversion without explicit `@FlexibleType` annotation, you can enable the `AutoFlexibleType` trait when adding the package dependency:
735
+
736
+
```swift
737
+
// In your Package.swift
738
+
.package(
739
+
url: "https://github.com/reers/ReerCodable.git",
740
+
from: "1.6.0",
741
+
traits: ["AutoFlexibleType"]
742
+
)
743
+
```
744
+
745
+
When this trait is enabled, all `@Codable` and `@Decodable` types will automatically support flexible type conversion, just like having `@FlexibleType` applied to every type. This is useful for projects that rely on backend APIs with inconsistent data types.
746
+
747
+
> **Note:** This feature requires Swift 6.1+ and swift-tools-version: 6.1 in your Package.swift.
748
+
749
+
> **Important:** After changing traits, you must **delete DerivedData/YourProject** and **restart Xcode** for the changes to take effect.
750
+
732
751
### 18. AnyCodable Support
733
752
734
753
Implement encoding/decoding of `Any` type through `AnyCodable`:
0 commit comments