vendredi 31 juillet 2015

how i use the weather.com site search in my app?

i want to use weather.com search engine. i used weather forecast-weather.com and it's easy to implement in my app because the url containing the name of the city

http://ift.tt/1rAAixy

this is my code now:

    let url = NSURL(string: "http://ift.tt/1rAAixy")

    let task = NSURLSession.sharedSession().dataTaskWithURL(url!, completionHandler: { (data, response, error) -> Void in

        if url != nil {

            let urlContent = NSString(data: data, encoding: NSUTF8StringEncoding)
            println(urlContent)
        }
    })

Aucun commentaire:

Enregistrer un commentaire