TKSegment

public class TKSegment : NSObject
extension TKSegment: MKAnnotation
extension TKSegment: UIActivityItemSource
extension TKSegment: TKURLShareable

Undocumented

  • The type of segment, .start and .end are terminal segments that just indicate the start and end locations. .regular indicates “normal” segments of moving around or changing modes.

    Declaration

    Swift

    @objc
    public let order: TKSegmentOrdering
  • Undocumented

    Declaration

    Swift

    @objc
    public let start: MKAnnotation!
  • end

    Undocumented

    Declaration

    Swift

    @objc
    public let end: MKAnnotation!
  • The previous segment in the same trip

    Can be a segment with a different order, e.g., it can be a terminal segment.

    Declaration

    Swift

    @objc
    public weak var previous: TKSegment?
  • The following segment in the same trip; can be a terminal segment

    Can be a segment with a different order, e.g., it can be a terminal segment.

    Declaration

    Swift

    @objc
    public weak var next: TKSegment?
  • The trip this segment belongs to

    Declaration

    Swift

    @objc
    public private(set) var trip: Trip! { get }

Initialisation

Inferred properties: Main

  • Undocumented

    Declaration

    Swift

    @objc
    public internal(set) var departureTime: Date { get set }
  • Undocumented

    Declaration

    Swift

    @objc
    public internal(set) var arrivalTime: Date { get set }
  • The local region this segment starts in. Cannot be international and thus might be nil.

    Declaration

    Swift

    public var startRegion: TKRegion? { get }
  • The local region this segment starts in. Cannot be international and thus might be nil.

    Declaration

    Swift

    public var endRegion: TKRegion? { get }
  • the transport mode identifier that this segment is using (if any). Can return nil for stationary segments such as “leave your house” or “wait between two buses” or “park your car”

    Declaration

    Swift

    @objc
    public lazy var modeIdentifier: String? { get set }
  • Undocumented

    Declaration

    Swift

    @objc
    public lazy var modeInfo: TKModeInfo? { get set }
  • Undocumented

    Declaration

    Swift

    public lazy var notifications: [TKAPI.TripNotification] { get set }
  • Undocumented

    Declaration

    Swift

    public var templateHashCode: Int
  • Undocumented

    Declaration

    Swift

    public var color: TKColor { get }
  • Undocumented

    Declaration

    Swift

    public var distanceByRoadTags: [Shape.RoadTag : Double]? { get }
  • A singe line instruction which is used on the map screen.

    Declaration

    Swift

    @objc
    public var singleLineInstruction: String? { get }
  • Undocumented

    Declaration

    Swift

    public var singleLineInstructionWithoutTime: String? { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public var notes: String? { get }
  • Undocumented

    Declaration

    Swift

    public var notesWithoutPlatforms: String? { get }
  • All alerts for this segment

    Declaration

    Swift

    @objc
    public lazy var alerts: [Alert] { get set }
  • Undocumented

    Declaration

    Swift

    public lazy var turnByTurnMode: TKTurnByTurnMode? { get set }
  • Undocumented

    Declaration

    Swift

    public lazy var type: TKSegmentType? { get set }
  • Undocumented

    Declaration

    Swift

    public var title: String? { get set }
  • Undocumented

    Declaration

    Swift

    public var titleWithoutTime: String? { get }
  • Undocumented

    Declaration

    Swift

    public var operatorInfo: TKAPI.CompanyInfo? { get }

Inferred properties: Simple

  • Undocumented

    Declaration

    Swift

    @objc
    public var isContinuation: Bool { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public var isWalking: Bool { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public var isWheelchair: Bool { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public var isCycling: Bool { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public var isDriving: Bool { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public var isFlight: Bool { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public var hasCarParks: Bool { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public var isPlane: Bool { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public var isPublicTransport: Bool { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public var isSelfNavigating: Bool { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public var isAffectedByTraffic: Bool { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public var isSharedVehicle: Bool { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public var isStationary: Bool { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public var durationWithoutTraffic: TimeInterval { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public var distanceInMetres: NSNumber? { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public var distanceInMetresFriendly: NSNumber? { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public var distanceInMetresUnfriendly: NSNumber? { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public var distanceInMetresDismount: NSNumber? { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public var _rawAction: String? { get }
  • Undocumented

    Declaration

    Swift

    public var bearing: NSNumber? { get }
  • Undocumented

    Declaration

    Swift

    public lazy var mapTiles: TKMapTiles? { get set }

Inferred properties: Shapes and visits

  • Undocumented

    Declaration

    Swift

    @objc
    public lazy var shapes: [Shape] { get set }
  • Undocumented

    Declaration

    Swift

    @objc(usesVisit:)
    public func uses(_ visit: StopVisits) -> Bool
  • Checks if one of the visited StopVisits objects matches the provided predicate

    Declaration

    Swift

    public func usesVisit(where predicate: (StopVisits) -> Bool) -> Bool?

    Parameters

    predicate

    Will be called for each visited

    Return Value

    true if the predicate returned true for any; false if it returned false for all, nil if visits have not been downloaded yet

  • Undocumented

    Declaration

    Swift

    public func shouldShow(_ visit: StopVisits) -> Bool
  • Checks if the provided visit matches this segment. This is not just for where the visit is used by this segment, but also for the parts before and after. This call deals with continuations and if the visit is part of a continuation, the visit is still considered to match this segment.

    Declaration

    Swift

    public func matches(_ visit: StopVisits) -> Bool

    Parameters

    visit

    The visit to match to this segment.

    Return Value

    If the provided visit is matching this segment.

  • Checks if segment’s shape pass near a coordinate

    Declaration

    Swift

    public func passesNear(_ coordinate: CLLocationCoordinate2D, maximumMeters: CLLocationDistance = 100) -> Bool

    Parameters

    coordinate

    A coordinate

    maximumMeters

    Maximum distance to return true

    Return Value

    true if any of the shapes of this segment pass near the provided coordinate.

  • Undocumented

    Declaration

    Swift

    public func startsAndEnds(inEncodedPolygon encodedPolygon: String) -> Bool

Inferred properties: Real-time

Inferred properties: Public transport

  • Undocumented

    Declaration

    Swift

    @objc
    public var service: Service? { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public var frequency: NSNumber? { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public var isCanceled: Bool { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public var scheduledServiceNumber: String? { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public var scheduledServiceCode: String? { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public lazy var scheduledStartStopCode: String? { get set }
  • Undocumented

    Declaration

    Swift

    @objc
    public lazy var scheduledEndStopCode: String? { get set }
  • Undocumented

    Declaration

    Swift

    @objc
    public lazy var scheduledStartPlatform: String? { get set }
  • Undocumented

    Declaration

    Swift

    @objc
    public lazy var scheduledEndPlatform: String? { get set }
  • Undocumented

    Declaration

    Swift

    @objc
    public lazy var scheduledTimetableStartTime: Date? { get set }
  • Undocumented

    Declaration

    Swift

    @objc
    public lazy var scheduledTimetableEndTime: Date? { get set }
  • Undocumented

    Declaration

    Swift

    @objc
    public lazy var ticketWebsiteURLString: String? { get set }
  • Undocumented

    Declaration

    Swift

    @objc
    public var embarkation: StopVisits? { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public var disembarkation: StopVisits? { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public var scheduledServiceStops: Int { get }

Inferred properties: Booking

Inferred properties: Shared vehicles

  • Undocumented

    Declaration

    Swift

    public lazy var sharedVehicle: TKAPI.SharedVehicleInfo? { get set }
  • Bicycle accessibility of the segment, returns nil if doesn’t apply to this kind of segment

    Declaration

    Swift

    var bicycleAccessibility: TKBicycleAccessibility? { get }
  • Alerts that also have a location associated with them

    Declaration

    Swift

    public var alertsWithLocation: [Alert] { get }
  • Alerts that have content, such as a description or URL

    Declaration

    Swift

    public var alertsWithContent: [Alert] { get }
  • Alerts that also have an action associated with them

    Declaration

    Swift

    public var alertsWithAction: [Alert] { get }
  • Gets the first alert that requires reroute

    Declaration

    Swift

    @objc
    public var reroutingAlert: Alert? { get }
  • Stationary segment type

    For details see TripGo API F.A.Q.

    See more

    Declaration

    Swift

    public enum StationaryType : String
  • Type for a stationary segment;,nil for non-stationary segments

    Declaration

    Swift

    public var stationaryType: StationaryType? { get }

TKUITripSegmentDisplayable

Helper methods

  • Undocumented

    Declaration

    Swift

    @objc(durationIncludingContinuation:)
    public func duration(includingContinuation: Bool) -> TimeInterval
  • Declaration

    Swift

    @objc
    public func finalSegmentIncludingContinuation() -> TKSegment

    Return Value

    The next segment after the current one that is not a continuation; if there’s no segment after returns self

  • Declaration

    Swift

    @objc
    public func originalSegmentIncludingContinuation() -> TKSegment

    Return Value

    The segment before the current one that is not a continuation; if there’s no segment before returns self

  • Undocumented

    Declaration

    Swift

    public var index: Int { get }
  • Undocumented

    Declaration

    Swift

    @objc
    public func triggerRealTimeKVO()
  • Undocumented

    Declaration

    Swift

    @objc
    public var timeZone: TimeZone { get }
  • Validates the segment, to make sure it’s in a consistent state. If it’s in an inconsistent state, many things can go wrong. You might want to add calls to this method to assertions and precondition checks.

    Declaration

    Swift

    @objc
    public func validate() -> Bool
  • Test if this segment has at least the specific length.

    Note

    public transport will always return true to this.

    Declaration

    Swift

    @objc
    public func hasVisibility(_ type: TKTripSegmentVisibility) -> Bool
  • Undocumented

    Declaration

    Swift

    @objc
    public func matchesQuery() -> Bool

Path info

Vehicles

  • Undocumented

    Declaration

    Swift

    @objc
    public var usesVehicle: Bool { get }
  • The private vehicle type used by this segment (if any)

    Declaration

    Swift

    public var privateVehicleType: TKVehicleType { get }
  • Declaration

    Swift

    public func assign(_ vehicle: TKVehicular?)

    Parameters

    vehicle

    Vehicle to assign to this segment. Only takes affect if its of a compatible type.

UIActivityItemSource

Wheelchair accessibility extensions