0

Hi I am beginning with swift and I got the error:

'String.Type' does not have a member named 'stringWithContentsOfURL'

Here is my code:

 func searchFlickrForString(searchStr:String, completion:(searchString:String!, flickrPhotos:NSMutableArray!, error:NSError!)->()){

    let searchURL:String = FlickrHelper.URLForSearchString(searchStr)
    let queue:dispatch_queue_t  = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)

    dispatch_async(queue, {
        var error:NSError?
        let searchResultString:String! = String.stringWithContentsOfURL(NSURL.URLWithString(searchURL), encoding: NSUTF8StringEncoding, error: &error)

Can anyone please suggest a suitable fix towards this problem as I can't seem to find any applicable resources online?

Shamas S
  • 7,507
  • 10
  • 46
  • 58
theenigma
  • 431
  • 1
  • 6
  • 6

0 Answers0