Deprecation of legacy ValueContainer and RelationshipContainer properties in favor of @Field propertyWrapper counterpart

This commit is contained in:
John Estropia
2024-01-28 22:11:21 +09:00
parent 4b6d9a54e7
commit 7c2129e38f
38 changed files with 936 additions and 2861 deletions

View File

@@ -27,35 +27,17 @@ import CoreData
import Foundation
// MARK: - DynamicObject
// MARK: - Deprecated
extension DynamicObject where Self: CoreStoreObject {
/**
The containing type for transformable properties. `Transformable` properties support types that conforms to `NSCoding & NSCopying`.
```
class Animal: CoreStoreObject {
let species = Value.Required<String>("species", initial: "")
let nickname = Value.Optional<String>("nickname")
let color = Transformable.Optional<UIColor>("color")
}
```
- Important: `Transformable` properties are required to be stored properties. Computed properties will be ignored, including `lazy` and `weak` properties.
*/
@available(*, deprecated, message: """
Legacy `Value.*`, `Transformable.*`, and `Relationship.*` declarations will soon be obsoleted. Please migrate your models and stores to new models that use `@Field.*` property wrappers. See: https://github.com/JohnEstropia/CoreStore?tab=readme-ov-file#new-field-property-wrapper-syntax
""")
public typealias Transformable = TransformableContainer<Self>
}
// MARK: - TransformableContainer
/**
The containing type for transformable properties. Use the `DynamicObject.Transformable` typealias instead for shorter syntax.
```
class Animal: CoreStoreObject {
let species = Value.Required<String>("species", initial: "")
let nickname = Value.Optional<String>("nickname")
let color = Transformable.Optional<UIColor>("color")
}
```
*/
@available(*, deprecated, message: """
Legacy `Value.*`, `Transformable.*`, and `Relationship.*` declarations will soon be obsoleted. Please migrate your models and stores to new models that use `@Field.*` property wrappers. See: https://github.com/JohnEstropia/CoreStore?tab=readme-ov-file#new-field-property-wrapper-syntax
""")
public enum TransformableContainer<O: CoreStoreObject> {}