Q:

URL not opening on UIWebView?

I try to open a webpage with a IBAction
@IBAction func Start(sender: AnyObject) {
    self.viewWebpage("http://www.xxxxx.xx")
}

func viewWebpage(webpage: String)
{
    let url = NSURL.fileURLWithPath(webpage)
    println(webpage)
    let request = NSURLRequest(URL: url!)
    self.viewPage.loadRequest(request)
   // self.viewPage.reload()
}

The webpage i try to open works when i change in the function the the url to
let url = NSURL(string: "http://www.xxxxxx.xx")

Where is my mistake? The println() prints out the wright url

A:

Issue is with:
let url = NSURL.fileURLWithPath(webpage)

You are converting the web url to file system url (url of a file contained in the system itself). So it won't work, you need to change that to:
let url = NSURL(string: webpage)

According to NSURL Class Reference

+ fileURLWithPath:
Initializes and returns a newly created NSURL object as a file URL
  with a specified path. Declaration
Swift
class func fileURLWithPath(_ path: String) -> NSURL?
Objective-C
+ (NSURL *)fileURLWithPath:(NSString *)path
Parameters
path 
The path that the NSURL object will represent. path should be a valid
  system path. If path begins with a tilde, it must first be expanded
  with stringByExpandingTildeInPath. If path is a relative path, it is
  treated as being relative to the current working directory.
Passing nil for this parameter produces an exception.
Return Value
An NSURL object initialized with path.
Discussion
This method assumes that path is a directory if it ends with a slash.
  If path does not end with a slash, the method examines the file system
  to determine if path is a file or a directory. If path exists in the
  file system and is a directory, the method appends a trailing slash.
  If path does not exist in the file system, the method assumes that it
  represents a file and does not append a trailing slash.
As an alternative, consider using fileURLWithPath:isDirectory:, which
  allows you to explicitly specify whether the returned NSURL object
  represents a file or directory.

