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!
-
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 }
-
Undocumented
Declaration
Swift
@objc(initAsTerminal:atLocation:forTrip:) public init(order: TKSegmentOrdering, location: MKAnnotation, trip: Trip)
-
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 }
-
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 }
-
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 predicateDeclaration
Swift
public func usesVisit(where predicate: (StopVisits) -> Bool) -> Bool?
Parameters
predicate
Will be called for each visited
Return Value
true
if the predicate returnedtrue
for any;false
if it returnedfalse
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
-
Undocumented
Declaration
Swift
@objc public var timesAreRealTime: Bool { get }
-
Undocumented
Declaration
Swift
@objc public var realTimeVehicle: Vehicle? { get }
-
Undocumented
Declaration
Swift
@objc public var realTimeAlternativeVehicles: [Vehicle] { get }
-
Undocumented
Declaration
Swift
@objc public var isImpossible: Bool { get }
-
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 }
-
Undocumented
Declaration
Swift
@objc public var bookingTitle: String? { get }
-
Undocumented
Declaration
Swift
public var bookingAccessibilityLabel: String? { get }
-
Undocumented
Declaration
Swift
public var bookingInternalURL: URL? { get }
-
Undocumented
Declaration
Swift
public var bookingVirtualURL: URL? { get }
-
Undocumented
Declaration
Swift
public var bookingQuickInternalURL: URL? { get }
-
Undocumented
Declaration
Swift
public var bookingExternalActions: [String]? { get }
-
Undocumented
Declaration
Swift
public var bookingConfirmation: TKBooking.Confirmation? { get }
-
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 segmentDeclaration
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 }
-
Declaration
Swift
public enum StationaryType : String
-
Type for a stationary segment;,
nil
for non-stationary segmentsDeclaration
Swift
public var stationaryType: StationaryType? { get }
-
Undocumented
Declaration
Swift
public var tripSegmentAccessibilityLabel: String? { get }
-
Undocumented
Declaration
Swift
@objc public var tripSegmentModeTitle: String? { get }
-
Undocumented
Declaration
Swift
public var tripSegmentModeSubtitle: String? { get }
-
Undocumented
Declaration
Swift
public var tripSegmentTimeZone: TimeZone? { get }
-
Undocumented
Declaration
Swift
public var tripSegmentModeImage: TKImage? { get }
-
Undocumented
Declaration
Swift
public var tripSegmentInstruction: String { get }
-
A short detail expanding on
tripSegmentInstruction
.Declaration
Swift
public var tripSegmentDetail: String? { get }
-
Undocumented
Declaration
Swift
public var tripSegmentTimesAreRealTime: Bool { get }
-
Undocumented
Declaration
Swift
public var tripSegmentWheelchairAccessibility: TKWheelchairAccessibility { get }
-
Undocumented
Declaration
Swift
public var tripSegmentBicycleAccessibility: TKBicycleAccessibility? { get }
-
Undocumented
Declaration
Swift
public var tripSegmentFixedDepartureTime: Date? { get }
-
Undocumented
Declaration
Swift
public var tripSegmentModeColor: TKColor? { get }
-
Undocumented
Declaration
Swift
public var tripSegmentModeImageURL: URL? { get }
-
Undocumented
Declaration
Swift
public var tripSegmentModeImageIsTemplate: Bool { get }
-
Undocumented
Declaration
Swift
public var tripSegmentModeImageIsBranding: Bool { get }
-
Undocumented
Declaration
Swift
public var tripSegmentModeInfoIconType: TKInfoIconType { get }
-
Undocumented
Declaration
Swift
public var tripSegmentSubtitleIconType: TKInfoIconType { get }
-
Ticket information, for public transport segments
See moreDeclaration
Swift
public struct Ticket : Codable, Hashable
-
The ticket of this segment
Note
This ticket’s validity might extend beyond this segment, e.g., if the trip uses multiple public transport segments and this ticket is also valid for the other segments.Declaration
Swift
public var ticket: Ticket? { get }
-
Undocumented
Declaration
Swift
public var subtitle: String? { get }
-
Undocumented
Declaration
Swift
public var coordinate: CLLocationCoordinate2D { get }
-
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 returntrue
to this.Declaration
Swift
@objc public func hasVisibility(_ type: TKTripSegmentVisibility) -> Bool
-
Undocumented
Declaration
Swift
@objc public func matchesQuery() -> Bool
-
Undocumented
Declaration
Swift
public var canShowPathFriendliness: Bool { get }
-
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.
-
Undocumented
Declaration
Swift
public func activityViewControllerPlaceholderItem(_ activityViewController: UIActivityViewController) -> Any
-
Undocumented
Declaration
Swift
public func activityViewController(_ activityViewController: UIActivityViewController, itemForActivityType activityType: UIActivity.ActivityType?) -> Any?
-
Wheelchair accessibility of the segment, returns
nil
if doesn’t apply to this kind of segmentDeclaration
Swift
var wheelchairAccessibility: TKWheelchairAccessibility? { get }
-
Undocumented
Declaration
Swift
public var storedQuickBookings: [TKQuickBooking]? { get }
-
Undocumented
Declaration
Swift
public var activeIndexQuickBooking: Int? { get set }
-
Undocumented
Declaration
Swift
public func storeQuickBookings(_ bookings: [TKQuickBooking])
-
Undocumented
Declaration
Swift
public var shareURL: URL? { get }