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 more

    Declaration

    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 more

    Declaration

    Swift

    class CoreDataHelper
  • View that is meant to be attached above keyboard, supplementing default name inputs.

    See more

    Declaration

    Swift

    @available(iOS 9.0, *)
    class DateFieldTypeView : UIScrollView
  • Each individual button that represents a date pattern

    See more

    Declaration

    Swift

    class DatePatternButton : UIButton
  • Handles processing of ‘unprocessed’ user input date format, processing of sample date format, etc

    See more

    Declaration

    Swift

    class DefaultDateFormat
  • It is an editor for the default file name.

    See more

    Declaration

    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 distance property.

    See more

    Declaration

    Swift

    open class DistanceLabel : UILabel
  • Defines an area extension by its top left and bottom right points

    See more

    Declaration

    Swift

    class GPXExtentCoordinates : NSObject
  • A handy way of getting info of a GPX file.

    It gets info like filename, modified date, filesize

    See more

    Declaration

    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 more

    Declaration

    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

    1. Send it by email
    2. Load in the map
    3. Delete the file

    It also displays a button “Done” in the navigation bar to return to the map.

    See more

    Declaration

    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

    1. A track is a set of segments.
    2. 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.
    See more

    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 GPXMapView.

    See more

    Declaration

    Swift

    class GPXSession
  • Handles all delegate functions of the GPX Mapview

    See more

    Declaration

    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
    See more

    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 kDefaultKeyTileServerInt (Int) and kDefaultUseCache` (Bool)

    See more

    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 more

    Declaration

    Swift

    class StopWatch : NSObject
  • Supporting UILabel for Toast.

    See more

    Declaration

    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 more

    Declaration

    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 more

    Declaration

    Swift

    class TrackerButton : UIButton
  • UILabel that accepts insets padding.

    See more

    Declaration

    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 more

    Declaration

    Swift

    class ViewController : UIViewController, UIGestureRecognizerDelegate
    extension ViewController: StopWatchDelegate
    extension ViewController: PreferencesTableViewControllerDelegate
    extension ViewController: GPXFilesTableViewControllerDelegate
    extension ViewController: CLLocationManagerDelegate