I am having a Protocol implementation as follows.
protocol DatabaseInjectable {
static func deriveObjectFromDBRow(row: [String]) -> Self? // Method - 1
static func collectAllObjectsForDatabaseAction(action: (Database) -> Void) -> [Self]? // Method - 2
}
Where I am successful with the correspondent implementation of Method - 1
like this:
static func deriveObjectFromDBRow(row: [String]) -> Self? {
...
}
But I could not implement the Method - 2
like this:
static func collectAllObjectsForDatabaseAction(action: (WWDatabase) -> Void) -> [Self]? {
...
}
There I am getting an error like this:
'Self' is only available in a protocol or as the result of a method in a class;
Any help to return the array form of Self
(the class it self) would be nice.