Classes
The following classes are available globally.
-
Declaration
Swift
@objc(CDRoot) public class CDRoot : NSManagedObject
-
Declaration
Swift
@objc(CDTrackpoint) public class CDTrackpoint : NSManagedObject
-
Declaration
Swift
@objc(CDWaypoint) public class CDWaypoint : NSManagedObject
-
Controller to display the About page.
Internally it is a WKWebView that displays the resource file about.html.
See moreDeclaration
Swift
class AboutViewController : UIViewController
extension AboutViewController: WKNavigationDelegate
-
Declaration
Swift
@UIApplicationMain class AppDelegate : UIResponder, UIApplicationDelegate
extension AppDelegate: WCSessionDelegate
-
Core Data implementation. As all Core Data related logic is contained here, I considered it as a helper.
Implementation learnt / inspired from 4 part series: https://marcosantadev.com/coredata_crud_concurrency_swift_1/
See moreDeclaration
Swift
class CoreDataHelper
-
View that is meant to be attached above keyboard, supplementing default name inputs.
See moreDeclaration
Swift
@available(iOS 9.0, *) class DateFieldTypeView : UIScrollView
-
Each individual button that represents a date pattern
See moreDeclaration
Swift
class DatePatternButton : UIButton
-
Handles processing of ‘unprocessed’ user input date format, processing of sample date format, etc
See moreDeclaration
Swift
class DefaultDateFormat
-
It is an editor for the default file name.
See moreDeclaration
Swift
class DefaultNameSetupViewController : UITableViewController, UITextFieldDelegate
-
A label to display distances.
The text is displated in meters if is less than 1km (for instance “980m”) and in km with two decimals if it is larger than 1km (for instance “1.20km”).
If
useImperial
is true, it displays the distance always in miles (“0.23mi”).To update the text displayed set the
See moredistance
property.Declaration
Swift
open class DistanceLabel : UILabel
-
Defines an area extension by its top left and bottom right points
See moreDeclaration
Swift
class GPXExtentCoordinates : NSObject
-
A handy way of getting info of a GPX file.
It gets info like filename, modified date, filesize
See moreDeclaration
Swift
class GPXFileInfo : NSObject
-
Class to handle actions with GPX files (save, delete, etc..)
It works on the default document directory of the app.
See moreDeclaration
Swift
class GPXFileManager : NSObject
-
TableViewController that displays the list of files that have been saved in previous sessions.
This view controller allows users to manage their GPX Files.
Currently the following actions with a file are supported
- Send it by email
- Load in the map
- Delete the file
It also displays a button “Done” in the navigation bar to return to the map.
See moreDeclaration
Swift
class GPXFilesTableViewController : UITableViewController, UINavigationBarDelegate
-
A MapView that Tracks user position
- it is able to convert GPX file into map
- it is able to return a GPX file from map
Some definitions
- A track is a set of segments.
- A segment is set of points. A segment is linked to a MKPolyline overlay in the map. Each time the user touches “Start Tracking” => a segment is created (currentSegment) Each time the users touches “Pause Tracking” => the segment is added to trackSegments When the user saves the file => trackSegments are consolidated in a single track that is added to the file. If the user opens the file in a session for the second, then tracks some seg ments and saves the file again, the resulting gpx file will have two tracks.
Declaration
Swift
class GPXMapView : MKMapView
-
Handles the actual logging of waypoints and trackpoints.
Addition of waypoints, trackpoints, and the handling of adding trackpoints to tracksegments and tracks all happens here. Exporting the data as a GPX string is also done here as well.
Should not be used directly on iOS, as code origins from
See moreGPXMapView
.Declaration
Swift
class GPXSession
-
Handles all delegate functions of the GPX Mapview
See moreDeclaration
Swift
class MapViewDelegate : NSObject, MKMapViewDelegate, UIAlertViewDelegate
-
A class to handle app preferences in one single place. When the app starts for the first time the following preferences are set:
- useCache = true
- useImperial = whatever is set by current locale (NSLocale.usesMetricUnits) or false
- tileServer = .apple
Declaration
Swift
class Preferences : NSObject
-
There are two preferences available:
- use or not cache
- select the map source (tile server)
Preferences are kept on UserDefaults with the keys
See morekDefaultKeyTileServerInt
(Int) andkDefaultUseCache
` (Bool)Declaration
Swift
class PreferencesTableViewController : UITableViewController, UINavigationBarDelegate, UIDocumentPickerDelegate
-
This class handles the logic behind a stop watch timer It has two statuses: started or stopped. When started it counts time. when stopped it does not count time.
See moreDeclaration
Swift
class StopWatch : NSObject
-
Supporting UILabel for Toast.
See moreDeclaration
Swift
class ToastLabel : UILabel
-
Display a toast message in a label for a few seconds and dissapears
Usage:
Toast.regular("My message") // It accepts delay in seconds and position (.top, .center .bottom) // There are .info, .warning, .error and .success toasts. Toast.info("My message", position: .top, delay: 10)
Originally extracted from https://stackoverflow.com/questions/31540375/how-to-create-a-toast-message-in-swift
See moreDeclaration
Swift
class Toast
-
Creates a button with rounded corners.
If the width and height are same, it is a circle.
By default a white background color is assigned.
See moreDeclaration
Swift
class TrackerButton : UIButton
-
UILabel that accepts insets padding.
See moreDeclaration
Swift
class UIInsetLabel : UILabel
-
Main View Controller of the Application. It is loaded when the application is launched
Displays a map and a set the buttons to control the tracking
See moreDeclaration
Swift
class ViewController : UIViewController, UIGestureRecognizerDelegate
extension ViewController: StopWatchDelegate
extension ViewController: PreferencesTableViewControllerDelegate
extension ViewController: GPXFilesTableViewControllerDelegate
extension ViewController: CLLocationManagerDelegate