Skip to content

Commit

Permalink
fix(xcode13): Xcode 13 beta compiler issues (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
VladislavFitz authored Sep 8, 2021
1 parent 2e0e66a commit 1665c7a
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public extension SingleIndexSearchConnector {

init<HC: HitsController>(searcher: SingleIndexSearcher,
searchController: UISearchController,
hitsInteractor: HitsInteractor<Record> = .init(),
hitsInteractor: HitsInteractor<Record>,
hitsController: HC,
filterState: FilterState? = nil) where HC.DataSource == HitsInteractor<Record> {
let queryInputInteractor = QueryInputInteractor()
Expand All @@ -42,7 +42,7 @@ public extension SingleIndexSearchConnector {
apiKey: APIKey,
indexName: IndexName,
searchController: UISearchController,
hitsInteractor: HitsInteractor<Record> = .init(),
hitsInteractor: HitsInteractor<Record>,
hitsController: HC,
filterState: FilterState? = nil) where HC.DataSource == HitsInteractor<Record> {
let searcher = SingleIndexSearcher(appID: appID,
Expand Down
2 changes: 1 addition & 1 deletion Sources/InstantSearch/SwiftUI/SearchBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public struct SearchBar: View {
@available(iOS 13.0, tvOS 13.0, watchOS 6.0, *)
public extension View {
func hideKeyboard() {
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
// UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public struct SingleIndexSearchConnector<Record: Codable>: Connection {
public init<HC: HitsController, QI: QueryInputController>(searcher: SingleIndexSearcher,
queryInputInteractor: QueryInputInteractor = .init(),
queryInputController: QI,
hitsInteractor: HitsInteractor<Record> = .init(),
hitsInteractor: HitsInteractor<Record>,
hitsController: HC,
filterState: FilterState? = nil) where HC.DataSource == HitsInteractor<Record> {
hitsConnector = .init(searcher: searcher, interactor: hitsInteractor, filterState: filterState)
Expand Down Expand Up @@ -88,7 +88,7 @@ public struct SingleIndexSearchConnector<Record: Codable>: Connection {
indexName: IndexName,
queryInputInteractor: QueryInputInteractor = .init(),
queryInputController: QI,
hitsInteractor: HitsInteractor<Record> = .init(),
hitsInteractor: HitsInteractor<Record>,
hitsController: HC,
filterState: FilterState? = nil) where HC.DataSource == HitsInteractor<Record> {
let searcher = SingleIndexSearcher(appID: appID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public protocol SelectableListController: class, Reloadable {
public protocol SelectableListController: AnyObject, Reloadable {

associatedtype Item

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public protocol ItemListController: class {
public protocol ItemListController: AnyObject {

associatedtype Item: Hashable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ public extension HitsConnector {
- externalReload: Defines if controller will be updated automatically by the events or manually
*/
convenience init<Controller: HitsController>(searcher: SingleIndexSearcher,
interactor: HitsInteractor<Hit> = .init(),
interactor: HitsInteractor<Hit>,
filterState: FilterState? = .none,
controller: Controller,
externalReload: Bool = false) where Controller.DataSource == HitsInteractor<Hit> {
self.init(searcher: searcher,
interactor: interactor,
filterState: filterState,
connectSearcher: interactor.connectSearcher,
connectSearcher: { interactor.connectSearcher($0) },
controller: controller,
externalReload: externalReload)
}
Expand Down Expand Up @@ -56,7 +56,7 @@ public extension HitsConnector {
self.init(searcher: searcher,
interactor: interactor,
filterState: filterState,
connectSearcher: interactor.connectSearcher,
connectSearcher: { interactor.connectSearcher($0) },
controller: controller,
externalReload: externalReload)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/InstantSearchCore/Hits/HitsSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public protocol HitsSource: class {
public protocol HitsSource: AnyObject {

associatedtype Record: Codable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

protocol InfiniteScrollable: class {
protocol InfiniteScrollable: AnyObject {

var lastPageIndex: Int? { get set }
var pageLoader: PageLoadable? { get set }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public protocol MultiIndexHitsSource: class {
public protocol MultiIndexHitsSource: AnyObject {

func numberOfSections() -> Int
func numberOfHits(inSection section: Int) -> Int
Expand Down
2 changes: 1 addition & 1 deletion Sources/InstantSearchCore/Pagination/PageLoadable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public protocol PageLoadable: class {
public protocol PageLoadable: AnyObject {

func loadPage(atIndex pageIndex: Int)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public protocol QueryInputController: class {
public protocol QueryInputController: AnyObject {
var onQueryChanged: ((String?) -> Void)? { get set }
var onQuerySubmitted: ((String?) -> Void)? { get set }
func setQuery(_ query: String?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public protocol HierarchicalFacetingDelegate: class {
public protocol HierarchicalFacetingDelegate: AnyObject {
var hierarchicalAttributes: [Attribute] { get set }
var hierarchicalFilters: [Filter.Facet] { get set }
}
5 changes: 3 additions & 2 deletions Sources/InstantSearchInsights/Logic/EventProcessor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ import AlgoliaSearchClient
/// - Storing of the events in the persistent storage (if provided)
/// - Forming the bounded packages of the events
/// – Synchronizing the events with a provided Service
class EventProcessor<Event, Service: EventsService, PackageStorage: Storage>: Flushable where Service.Event == Event,
PackageStorage.Item == [Package<Event>] {
class EventProcessor<Service: EventsService, PackageStorage: Storage>: Flushable where PackageStorage.Item == [Package<Service.Event>] {

public typealias Event = Service.Event

/// The service to sync the events with
let service: Service
Expand Down
10 changes: 5 additions & 5 deletions Tests/InstantSearchTests/Snippets/HitsSnippets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ class HitsSnippets {
let filterState: FilterState = .init()
let hitsTableViewController = CustomHitsTableViewController()
let hitsConnector = HitsConnector<CustomHitModel>(appID: "YourApplicationID",
apiKey: "YourSearchOnlyAPIKey",
indexName: "YourIndexName",
filterState: filterState,
controller: hitsTableViewController)
apiKey: "YourSearchOnlyAPIKey",
indexName: "YourIndexName",
filterState: filterState,
controller: hitsTableViewController)



hitsConnector.searcher.search()
}

Expand Down

0 comments on commit 1665c7a

Please sign in to comment.