I have read the basic's on the Swift programming language such as variables, classes, functions etc. What I don't understand is when I start trying to build an application, is the structure of how you set up a function. I am guessing **function**, or what I list below. I will elaborate the best I can.

I'd like to understand how people know, or where to learn what to put when your trying to accomplish something.

For example I Googled making a HTTP call and this code came up:

```
let request = URLRequest(url: NSURL(string: "https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY")! as URL)
do {
    // Perform the request
    var response: AutoreleasingUnsafeMutablePointer<URLResponse?>? = nil
    let data = try NSURLConnection.sendSynchronousRequest(request, returning: response)

```

I get totally lost on the part with:

```
URLRequest(url: NSURL(string: "https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY")! as URL)

```

Where do you read to learn when to use things such as URLRequest, or how or when to put url: in front of it. Even though this is just one example, I notice in building a swift application you guys use things such as NSUrl, NSObject, URLRequest. And in the documentation I have not learned about these things. And I don't understand how you guys know when to put question marks "?", or how you format it your functions like the example above.

If I am not asking this correctly, I can always explain more.

If you know what I can search for online so I can know what I am trying to learn, that would be helpful. Or a book that teaches you about UIWindows, and basic functions using stuff like NSObject and UIWindows that would be helpful.

**What is difficult is understanding the API documentation. If you can't understand the api documentation, and syntax. How can you ever learn. I guess its easier, to learn by example sometimes.**