> For the complete documentation index, see [llms.txt](https://docs-old.telematicssdk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-old.telematicssdk.com/sdk-installation/ios-sdk-intallation/add-list-of-trips-to-your-viewcontroller.md).

# Add list of trips to your ViewController

You need to perform async request to get completed tracks:

Objective-c:

```
- (void)loadTracks {
    [[RPEntry instance].api getTracksWithOffset:0 limit:100 completion:^(id response, NSError *error) {
        if (error != nil) {
            return;
        }
        
        if (![response isKindOfClass:[RPFeed class]]) {
            return;
        }
        
        RPFeed *feed = response;
        NSArray <RPTrackProcessed *> *tracks = feed.tracks;
 
        dispatch_async(dispatch_get_main_queue(), ^{
     /// Implement updating your ViewController with new data            
        });
 
 
    }];
}
```

Swift:&#x20;

```
func loadTracks() {
    RPEntry.instance().api.getTracks(0, limit: 100) { (response, error) in
        if let feed = response as? RPFeed {
            let tracks = feed.tracks;
            DispatchQueue.main.async {
                /// Implement updating your ViewController with new data
            }
        }
        if (error != nil) {
            DispatchQueue.main.async {
                /// Implement alert or logging
            }
        }
    }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-old.telematicssdk.com/sdk-installation/ios-sdk-intallation/add-list-of-trips-to-your-viewcontroller.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
