File tree Expand file tree Collapse file tree 3 files changed +40
-0
lines changed
GPXKit/CoreGPX Playground.playground Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 5050 B1FA67C144CC465C6B228AB8 /* GPXKit.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = GPXKit.podspec; path = ../GPXKit.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
5151 BF67E9292217F2EE008B6202 /* GPXTest-TrackPointOnly.gpx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "GPXTest-TrackPointOnly.gpx"; sourceTree = "<group>"; };
5252 BF693E5022C8A69A00CBCE5A /* CoreGPX.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; fileEncoding = 4; name = CoreGPX.podspec; path = ../CoreGPX.podspec; sourceTree = "<group>"; };
53+ BF693E5422C8E71B00CBCE5A /* CoreGPX Playground.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = "CoreGPX Playground.playground"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
5354 BF7F905C21F7501800359484 /* CreationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreationViewController.swift; sourceTree = "<group>"; };
5455 BFD4523C21E9F17A002ECA3A /* ParseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseViewController.swift; sourceTree = "<group>"; };
5556 E4C0F7E2E749B02F23048D43 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
100101 607FACD21AFB9204008FA782 /* Example for CoreGPX */ = {
101102 isa = PBXGroup;
102103 children = (
104+ BF693E5422C8E71B00CBCE5A /* CoreGPX Playground.playground */,
103105 607FACD51AFB9204008FA782 /* AppDelegate.swift */,
104106 607FACD71AFB9204008FA782 /* ViewController.swift */,
105107 BF7F905C21F7501800359484 /* CreationViewController.swift */,
Original file line number Diff line number Diff line change 1+ import Foundation
2+ import CoreGPX
3+
4+ // Example: Generate GPX string
5+
6+ let root = GPXRoot ( creator: " CoreGPX Playground " )
7+
8+ let track = GPXTrack ( )
9+ let firstSegment = GPXTrackSegment ( )
10+
11+ let metadata = GPXMetadata ( )
12+
13+ metadata. time = Date ( )
14+ metadata. copyright = GPXCopyright ( author: " Vincent Neo " )
15+ metadata. desc = " This GPX File is created to facilitate the understanding of CoreGPX library's usage! "
16+
17+ root. metadata = metadata
18+
19+ let firstTrkPt = GPXTrackPoint ( latitude: 1.2345 , longitude: 2.3456 )
20+ firstTrkPt. elevation = 31.92492
21+ firstTrkPt. extensions = GPXExtensions ( )
22+ firstTrkPt. extensions![ " customproperties " ] = [ " Location " : " Sembawang, Singapore " , " CompassDegree " : " 120 " ]
23+
24+ let secondTrkPt = GPXTrackPoint ( latitude: 0.294 , longitude: 38.019 )
25+
26+ firstSegment. add ( trackpoint: firstTrkPt)
27+ firstSegment. add ( trackpoint: secondTrkPt)
28+
29+ track. add ( trackSegment: firstSegment)
30+
31+ root. add ( track: track)
32+
33+ print ( root. gpx ( ) )
34+
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" standalone =" yes" ?>
2+ <playground version =' 5.0' target-platform =' ios' executeOnSourceChanges =' false' >
3+ <timeline fileName =' timeline.xctimeline' />
4+ </playground >
You can’t perform that action at this time.
0 commit comments