TKSegment

public class TKSegment : NSObject
extension TKSegment: TKTripSegment
extension TKSegment: MKAnnotation
extension TKSegment: UIActivityItemSource
extension TKSegment: TKURLShareable
  • Declaration

    Swift

    @objc
    public let order: TKSegmentOrdering
  • Declaration

    Swift

    @objc
    public let start: MKAnnotation?
  • end

    Declaration

    Swift

    @objc
    public let end: MKAnnotation?
  • Declaration

    Swift

    @objc
    public weak var previous: TKSegment?
  • Declaration

    Swift

    @objc
    public weak var next: TKSegment?
  • Declaration

    Swift

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

Initialisation

Inferred properties: Main

  • Declaration

    Swift

    @objc
    public internal(set) var departureTime: Date { get set }
  • 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 }
  • Declaration

    Swift

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

    Swift

    public var templateHashCode: Int { get }
  • Declaration

    Swift

    public var color: TKColor { get }
  • A singe line instruction which is used on the map screen.

    Declaration

    Swift

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

    Swift

    public var singleLineInstructionWithoutTime: String? { get }
  • Declaration

    Swift

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

    Swift

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

    Declaration

    Swift

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

    Swift

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

    Swift

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

    Swift

    @objc
    public var title: String? { get set }
  • Declaration

    Swift

    public var titleWithoutTime: String? { get }

Inferred properties: Simple

  • Declaration

    Swift

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

    Swift

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

    Swift

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

    Swift

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

    Swift

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

    Swift

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

    Swift

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

    Swift

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

    Swift

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

    Swift

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

    Swift

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

    Swift

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

    Swift

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

    Swift

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

    Swift

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

    Swift

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

    Swift

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

    Swift

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

    Swift

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

    Swift

    public var bearing: NSNumber? { get }
  • Declaration

    Swift

    public lazy var mapTiles: TKMapTiles? { get set }

Inferred properties: Shapes and visits

  • Declaration

    Swift

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

    Swift

    @objc(usesVisit:)
    public func uses(_ visit: StopVisits) -> Bool
  • Declaration

    Swift

    @objc(shouldShowVisit:)
    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.

Inferred properties: Real-time

Inferred properties: Public transport

Inferred properties: Booking

Inferred properties: Shared vehicles

  • Declaration

    Swift

    public lazy var sharedVehicleData: NSDictionary? { get set }
  • 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 }

TKTripSegment

Helper methods

  • Declaration

    Swift

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

    Swift

    @objc
    public func finalSegmentIncludingContinuation() -> TKSegment
  • Declaration

    Swift

    @objc
    public func originalSegmentIncludingContinuation() -> TKSegment
  • Declaration

    Swift

    public var index: Int { get }
  • Declaration

    Swift

    @objc
    public func triggerRealTimeKVO()
  • 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
  • Declaration

    Swift

    @objc
    public func matchesQuery() -> Bool

Path info

Vehicles

  • Declaration

    Swift

    @objc
    public var usesVehicle: Bool { get }
  • Declaration

    Swift

    @objc
    public func usedVehicle(fromAll vehicles: [TKVehicular]) -> [AnyHashable : Any]?

    Parameters

    vehicles

    List of the user’s vehicles

    Return Value

    The used vehicle (if there are any) in SkedGo API-compatible form

  • The private vehicle type used by this segment (if any)

    Declaration

    Swift

    @objc
    public var privateVehicleType: TKVehicleType { get }
  • Declaration

    Swift

    @objc
    public func assignVehicle(_ vehicle: TKVehicular?)

    Parameters

    vehicle

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

UIActivityItemSource

Wheelchair accessibility extensions