Skip to content

Commit

Permalink
chore: deprecate Places components (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
VladislavFitz authored Jul 6, 2022
1 parent 7c9cfa9 commit 180909a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
import Foundation

extension Hit: Geolocated {}

@available(*, deprecated, message: "Places feature is deprecated")
public typealias PlaceHit = Hit<Place>

@available(*, deprecated, message: "Places feature is deprecated")
public extension HitsConnector where Hit == PlaceHit {

/**
Expand All @@ -18,6 +21,7 @@ public extension HitsConnector where Hit == PlaceHit {
- searcher: Places Searcher that handles your searches
- interactor: External hits interactor
*/
@available(*, deprecated, message: "Places feature is deprecated")
convenience init(searcher: PlacesSearcher,
interactor: HitsInteractor<Hit>) {
self.init(searcher: searcher,
Expand All @@ -34,6 +38,7 @@ public extension HitsConnector where Hit == PlaceHit {
- infiniteScrolling: Whether or not infinite scrolling is enabled
- showItemsOnEmptyQuery: If false, no results are displayed when the user hasn’t entered any query text
*/
@available(*, deprecated, message: "Places feature is deprecated")
convenience init(placesAppID: ApplicationID,
apiKey: APIKey,
infiniteScrolling: InfiniteScrolling = Constants.Defaults.infiniteScrolling,
Expand All @@ -48,6 +53,7 @@ public extension HitsConnector where Hit == PlaceHit {

}

@available(*, deprecated, message: "Places feature is deprecated")
public extension HitsConnector where Hit == PlaceHit {

/**
Expand All @@ -57,6 +63,7 @@ public extension HitsConnector where Hit == PlaceHit {
- interactor: External hits interactor
- controller: Controller interfacing with a concrete hits view
*/
@available(*, deprecated, message: "Places feature is deprecated")
convenience init<Controller: GeoHitsController>(searcher: PlacesSearcher,
interactor: HitsInteractor<Hit>,
controller: Controller) where Controller.DataSource == HitsInteractor<PlaceHit> {
Expand All @@ -76,6 +83,7 @@ public extension HitsConnector where Hit == PlaceHit {
- showItemsOnEmptyQuery: If false, no results are displayed when the user hasn’t entered any query text
- controller: Controller interfacing with a concrete hits view
*/
@available(*, deprecated, message: "Places feature is deprecated")
convenience init<Controller: GeoHitsController>(placesAppID: ApplicationID,
apiKey: APIKey,
infiniteScrolling: InfiniteScrolling = Constants.Defaults.infiniteScrolling,
Expand All @@ -96,6 +104,7 @@ public extension HitsConnector where Hit == PlaceHit {
- controller: Controller interfacing with a concrete hits view
- Returns: Established connection
*/
@available(*, deprecated, message: "Places feature is deprecated")
@discardableResult func connectController<Controller: GeoHitsController>(_ controller: Controller) -> HitsInteractor<PlaceHit>.GeoHitsControllerConnection<Controller> where Controller.DataSource == HitsInteractor<PlaceHit> {
let connection = interactor.connectController(controller)
controllerConnections.append(connection)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import Foundation

@available(*, deprecated, message: "Places feature is deprecated")
public extension HitsInteractor where Record == Hit<Place> {

struct PlacesSearcherConnection: Connection {
Expand Down Expand Up @@ -48,6 +49,7 @@ public extension HitsInteractor where Record == Hit<Place> {

public extension HitsInteractor where Record == Hit<Place> {

@available(*, deprecated, message: "Places feature is deprecated")
@discardableResult func connectPlacesSearcher(_ searcher: PlacesSearcher) -> PlacesSearcherConnection {
let connection = PlacesSearcherConnection(interactor: self, searcher: searcher)
connection.connect()
Expand Down
1 change: 1 addition & 0 deletions Sources/InstantSearchCore/Pagination/PageLoadable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ extension FacetSearcher: PageLoadable {

}

@available(*, deprecated, message: "Places feature is deprecated")
extension PlacesSearcher: PageLoadable {

public func loadPage(atIndex pageIndex: Int) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import Foundation
import AlgoliaSearchClient

@available(*, deprecated, message: "Places feature is deprecated")
final public class PlacesSearcher: AbstractSearcher<AlgoliaPlacesSearchService> {

public var placesQuery: PlacesQuery {
Expand Down

0 comments on commit 180909a

Please sign in to comment.