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
import CoreData
import Foundation
import ValidatedPropertyKit
extension EditView {
class ViewModel: NSObject, ObservableObject {
let item: Item
let add: Bool
let hasRelationship: Bool
private let dataController: DataController
@Validated(!.isEmpty)
@Published var title = "" <= error
// @Published var title: String <= error
What did you expect to happen?
To access the variable as shown in the readme examples.
What happened instead?
Error....
Referencing initializer 'init(wrappedValue:_:nilValidation:)' on 'Validated' requires
that 'Published<String>' conform to 'Optionalable'
I'm not sure why this is occurring?
Thanks in advance.
The text was updated successfully, but these errors were encountered:
As you are applying the @Validated property wrapper to an @Published declared property the resulting type of the Validated property wrapper is a Published<String> which results in a compile error as the isEmpty validation rule can only be applied to types that conform to the Collection protocol.
ValidatedPropertyKit Environment
ValidatedPropertyKit version:
0.0.5
macOS version:
11.6.2
Xcode version:
13.2.1
Dependency manager (Carthage, CocoaPods, SPM, Manually):
SPM
What did you do?
I'm using a view model.
What did you expect to happen?
To access the variable as shown in the readme examples.
What happened instead?
Error....
I'm not sure why this is occurring?
Thanks in advance.
The text was updated successfully, but these errors were encountered: