TKPlacesManager

@interface TKPlacesManager : NSObject

A working manager used to query for Place objects.

  • Shared Places managing instance.

    Declaration

    Objective-C

    @property (readonly, strong, atomic, class)
        TKPlacesManager *_Nonnull sharedManager;

    Swift

    class var shared: TKPlacesManager { get }
  • Returns a collection of TKPlace objects for the given query object.

    This method is good for fetching Places to use for lists, map annotations and other batch uses.

    Declaration

    Objective-C

    - (void)placesForQuery:(nonnull TKPlacesQuery *)query
                completion:(nonnull void (^)(NSArray<TKPlace *> *_Nullable,
                                             NSError *_Nullable))completion;

    Swift

    func places(for query: TKPlacesQuery, completion: @escaping ([TKPlace]?, Error?) -> Void)

    Parameters

    query

    TKPlacesQuery object containing the desired attributes to look for.

    completion

    Completion block called on success or error.

  • Returns a collection of TKPlace objects for the given IDs.

    Declaration

    Objective-C

    - (void)detailedPlacesWithIDs:(nonnull NSArray<NSString *> *)placeIDs
                       completion:
                           (nonnull void (^)(NSArray<TKDetailedPlace *> *_Nullable,
                                             NSError *_Nullable))completion;

    Swift

    func detailedPlaces(withIDs placeIDs: [String], completion: @escaping ([TKDetailedPlace]?, Error?) -> Void)

    Parameters

    placeIDs

    Array of strings matching desired Place IDs.

    completion

    Completion block called on success or error.

  • Returns a Detailed TKPlace object for the given global Place identifier.

    This method is good for fetching further Place information to use f.e. on Place Detail screen.

    Declaration

    Objective-C

    - (void)detailedPlaceWithID:(nonnull NSString *)placeID
                     completion:(nonnull void (^)(TKDetailedPlace *_Nullable,
                                                  NSError *_Nullable))completion;

    Swift

    func detailedPlace(withID placeID: String, completion: @escaping (TKDetailedPlace?, Error?) -> Void)

    Parameters

    placeID

    Global identifier of the desired Place.

    completion

    Completion block called on success or error.

  • Returns a collection of TKMedium objects for the given global Place identifier.

    This method is used to fetch all Place media to be used f.e. for Gallery screen.

    Declaration

    Objective-C

    - (void)mediaForPlaceWithID:(nonnull NSString *)placeID
                     completion:(nonnull void (^)(NSArray<TKMedium *> *_Nullable,
                                                  NSError *_Nullable))completion;

    Swift

    func mediaForPlace(withID placeID: String, completion: @escaping ([TKMedium]?, Error?) -> Void)

    Parameters

    placeID

    Global identifier of the desired Place.

    completion

    Completion block called on success or error.

  • Returns a collection of TKCollection objects for the given query object.

    This method is good for fetching collections to display with a Destination to list the most interesting Places within.

    Declaration

    Objective-C

    - (void)placeCollectionsForQuery:(nonnull TKCollectionsQuery *)query
                          completion:
                              (nonnull void (^)(NSArray<TKCollection *> *_Nullable,
                                                NSError *_Nullable))completion;

    Swift

    func placeCollections(for query: TKCollectionsQuery, completion: @escaping ([TKCollection]?, Error?) -> Void)

    Parameters

    query

    TKCollectionsQuery object containing the desired attributes to look for.

    completion

    Completion block called on success or error.