I have tried to make my own currency converter from USD to SEK With the import taxes rates to Sweden but I have no clue how to take a value from a website. I have tried to find it on my own but I can't really find anything so I´m hopping anyone here could help me with this? This is how far I have built the app. I want to use this link http://www.valutaomvandling.se/usd-sek-1.html to take innformation from the code down below is the ViewController and is essentially use less but its there just to show. I only know how to go in to a website through a code like this But i don't know how to take information from a website thats where you come in hope you understand what I mean and I would be really grateful for any help.
let rect = CGRectMake(0, 20, 320, 460)
let webView = UIWebView(frame: rect)
let url = NSURL(string: "https://www.apple.com”)
let request = NSURLRequest(URL: url!)
webView.loadRequest(request)
self.view.addSubview(webView)
import UIKit
class ImportSkattViewController: UIViewController {
@IBOutlet weak var textfield: UITextField!
@IBOutlet weak var svar: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
textfield.keyboardType = UIKeyboardType.DecimalPad
let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: "dismissKeyboard")
view.addGestureRecognizer(tap)
// Do any additional setup after loading the view.
}
func dismissKeyboard() {
//Causes the view (or one of its embedded text fields) to resign the first responder status.
view.endEditing(true)
if textfield.text == ""{
}
else{
let nf = NSNumberFormatter()
let atext2 = nf.numberFromString(textfield.text!)
let skatt = 1.25
let CurencyValue = 0
let result = Float(atext2!) * Float(skatt) * Float(CurencyValue)
svar.text = ("\(result)")
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}