GPXParser

public final class GPXParser : NSObject
extension GPXParser: XMLParserDelegate

An event-driven parser (SAX parser), currently parses GPX v1.1 files only.

This parser is already setted up, hence, does not require any handling, and will parse files directly as objects. To get the parsed data from a GPX file, simply initialize the parser, and get the GPXRoot from parsedData().

  • for parsing with Data type

    Declaration

    Swift

    public init(withData data: Data)

    Parameters

    data

    The input must be Data object containing GPX markup data, and should not be nil

  • for parsing with InputStream type

    Declaration

    Swift

    public init(withStream stream: InputStream)

    Parameters

    stream

    The input must be a input stream allowing GPX markup data to be parsed synchronously

  • for parsing with URL type

    Declaration

    Swift

    public init?(withURL url: URL)

    Parameters

    url

    The input must be a URL, which should point to a GPX file located at the URL given

  • for parsing with a string that contains full GPX markup

    Declaration

    Swift

    public convenience init?(withRawString string: String?)

    Parameters

    string

    The input String must contain full GPX markup, which is typically contained in a .GPX file

  • for parsing with a path to a GPX file

    Declaration

    Swift

    public convenience init?(withPath path: String)

    Parameters

    path

    The input path, with type String, must contain a path that points to a GPX file used to facilitate parsing.

Main Parse Method

Failible Parse Type