I need a method that converts string to the generic type:

i tried this so far but it doesn't work on Int objects. When i pass object as Int to this method, it won't return Int result. Can you please help me.
An example;

```
let k : Int
gg(k,"testUrl") // Problem: this method call can't return int value.

func gg<T:Decodable>(_ nesne: T, _ URL: String) -> (T) {
   var returnValue : T?
   let data = "123" // <-- from web service
   returnValue = data as! T
   return returnValue
}

```