-1

I Update old app to swift 3 and I have some migration errors. on this part of code :

func done(_ request: URLRequest?, response: HTTPURLResponse?) {
    let visibleCells = tableView.visibleCells as! [NewsStoryCell]
    let cells = visibleCells.filter({ $0.news.thumbUrl == request?.URLString })

    if let cell = cells.first {
        cell.reloadThumbImage()
    }
}

I have error:

Value of type 'URLRequest' has no member 'URLString'

on:

$0.news.thumbUrl == request?.URLString

pacification
  • 5,838
  • 4
  • 29
  • 51
Voltan
  • 25
  • 7
  • [This](https://stackoverflow.com/questions/28500128/nsurlrequest-does-not-have-a-member-named-url-swift) can be helpful – Anurag Sharma Sep 07 '17 at 10:10

1 Answers1

7

It has indeed been changed in Swift 3

$0.news.thumbUrl = request?.url?.absoluteString
mag_zbc
  • 6,801
  • 14
  • 40
  • 62