I wanted to pass nil value in a function of protocol but protocol gives error: "Default argument not permitted in a protocol method"
protocol CoreDataRepositoryProtocol: ExpressibleByNilLiteral{
func fetchData<T:NSManagedObject>(entity: T.Type, enityName: entittytype, predicate: NSPredicate? = nil) -> [T]?
func getOne <T:NSManagedObject>(entity: T.Type, enityName: String, predicate: NSPredicate) -> T?
func deleteRec<T:NSManagedObject>(entity: T.Type, entityName:entittytype, predicate: NSPredicate, completion: @escaping (String) -> Void) -> Bool
func saveObject()
}
The first function , I want to add predicate as predicate:NSPredicate?=nil
but protocol is not accepting