AI-generated Key Takeaways
-
GMTCTripServiceprovides methods to access trip sessions, primarily throughGMTCTripModelinstances. -
You can retrieve a
GMTCTripModelinstance for a specific trip name, reusing existing instances if they have already been created. -
The
GMTCTripServicecan determine if aGMTCTripModelinstance exists for a given trip name, using thehasTripModelForTripName:method. -
You can get all created trip session objects, or all actively running ones, using the
allTripModelsoractiveTripModelsmethods, respectively. -
The
GMTCTripServiceclass does not have any public initializers, making direct initialization unavailable.
GMTCTripService
@interface GMTCTripService : NSObjectProvides methods for accessing trip session(s).
-
Creates and returns an instance of
GMTCTripModelby 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 thesessionOptionsofGMTCTripModel. Usually thissessionOptionsproperty can be used to adjust the refresh time interval between the repeated trip info polling. see the comment in the classGMTCTripModelOptionsfor more details.Declaration
Swift
func tripModel(forTripName tripName: String) -> GMTCTripModel?Objective-C
- (nullable GMTCTripModel *)tripModelForTripName:(nonnull NSString *)tripName;Parameters
tripNameThe 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) -> BoolObjective-C
- (BOOL)hasTripModelForTripName:(nonnull NSString *)tripName;Parameters
tripNameThe 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;