Skip to content

Instantly share code, notes, and snippets.

@polac24
Created March 31, 2019 18:02
Show Gist options
  • Save polac24/67f05b5d9b076552c28a7a679ec552cd to your computer and use it in GitHub Desktop.
Save polac24/67f05b5d9b076552c28a7a679ec552cd to your computer and use it in GitHub Desktop.
protocol Database {
func addUser<T>(user: T) -> Bool
}
class DatabaseStub<User>: Database {
lazy var addUserAction: (T) -> Bool
func addUser<T>(user: T) -> Bool {
return addUserAction(user as! User)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment