AI-generated Key Takeaways
-
GMTCTripService
provides methods to access trip sessions, primarily throughGMTCTripModel
instances. -
You can retrieve a
GMTCTripModel
instance for a specific trip name, reusing existing instances if they have already been created. -
The
GMTCTripService
can determine if aGMTCTripModel
instance exists for a given trip name, using thehasTripModelForTripName:
method. -
You can get all created trip session objects, or all actively running ones, using the
allTripModels
oractiveTripModels
methods, respectively. -
The
GMTCTripService
class does not have any public initializers, making direct initialization unavailable.
GMTCTripService
@interface GMTCTripService : NSObject
Provides methods for accessing trip session(s).
-
Creates and returns an instance of
GMTCTripModel
by the given trip name. If a trip session instance has already been created for the given trip name, then that instance will be returned. The instance of the TripModel created or retrieved can be configured via thesessionOptions
ofGMTCTripModel
. Usually thissessionOptions
property can be used to adjust the refresh time interval between the repeated trip info polling. see the comment in the classGMTCTripModelOptions
for more details.Declaration
Swift
func tripModel(forTripName tripName: String) -> GMTCTripModel?
Objective-C
- (nullable GMTCTripModel *)tripModelForTripName:(nonnull NSString *)tripName;
Parameters
tripName
The trip name for identifying a trip.
-
Returns whether there has been a trip session created by the
GMTCTripService
.Declaration
Swift
func hasTripModel(forTripName tripName: String) -> Bool
Objective-C
- (BOOL)hasTripModelForTripName:(nonnull NSString *)tripName;
Parameters
tripName
The trip name for identifying a trip.
-
Returns all the trip session objects created by this trip service.
Declaration
Swift
func allTripModels() -> [GMTCTripModel]
Objective-C
- (nonnull NSArray<GMTCTripModel *> *)allTripModels;
-
Returns all the trip session objects created by this trip service which are actively running.
Declaration
Swift
func activeTripModels() -> [GMTCTripModel]
Objective-C
- (nonnull NSArray<GMTCTripModel *> *)activeTripModels;
-
Unavailable
This class has no public initializers.
Declaration
Objective-C
- (null_unspecified instancetype)init;