I have this code in Objective-C which works with the `initWithRequest` of `NSURLConnection` class and Xcode gives me the following warning: 

> 
> initWithRequest is deprecated: first deprecated in iOS9 - Use NSURLSession
> 
> 
> 

My `ViewController.m` code is as follows:

```
NSString url = "my url"; 
NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:url];
conexion = [[NSURLConnection alloc]initWithRequest:req delegate:self];

```

`Conexion` is `NSURLConnection` in `ViewController.h`, so i was wondering how to switch from `NSURLConnection` to `NSURLSession`.