In java, you may have a general method similar to the one below, where the type is explicitly specified and passed to the method as an argument. Is this possible with a quick one?
public T fetchObject(Class<T> clazz, int id) {
What am i trying to achieve
public func fetchObject (id: Int ) -> T? {
generics swift
aryaxt
source share