Latest 1.1.0
License MIT
Platforms ios 8.0, osx 10.10, tvos 9.0, watchos 2.0, requires ARC
Dependencies AEXML

GPXKit CI Status Version License Platform

GPXKit is allows you to easily parse a GPX file in Swift.

GPX format

The currently supported GPX format is version 1.1 as described in the schema documentation.


Add this pod to your Podfile by adding the following line:

pod 'GPXKit', '~> 1.1'

It’s important to add the version to the pod 'GPXKit', this way you are sure that a next update of the pod will not break your code.


You can take a look at the different specs on how to use this pod. But for now I describe in short how it can be used.

Here is a sample GPX file with some data:

<gpx creator='GPXKit'>
    <name>Jelle Vandebeeck</name>
    <desc>A GPX file</desc>
    <keywords>hiking, forest, wild</keywords>

The only thing you have to do is make sure to get the contents of the GPX file into an NSData structure. When you have this you can easily parse the file into a GKFile.

let content: String = '...'
let data = content.dataUsingEncoding(NSUTF8StringEncoding)
let file = try! GKParser(data: data).parse()

When the parsing fails an error will be thrown. There are currently two types of errors:

  • invalidData thrown when the data object is empty.
  • invalidFormat thrown when the data object can’t be parsed.
  • invalidVersion thrown when the data object contains an incorrect version of the GPX file.


GPXKit is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "GPXKit",
    "version": "1.1.0",
    "summary": "Parse a GPX file into a readable format with Swift.",
    "description": "This pod makes it possible to parse a GPX file to a format that cannbe easily used in your code.",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "Jelle Vandebeeck": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.1.0"
    "social_media_url": "",
    "platforms": {
        "ios": "8.0",
        "osx": "10.10",
        "tvos": "9.0",
        "watchos": "2.0"
    "requires_arc": true,
    "source_files": "Sources/**/*",
    "dependencies": {
        "AEXML": [
            "~> 3.0"

Pin It on Pinterest

Share This