Skip to content

Commit

Permalink
fix(access-control): change access level from public to internal for …
Browse files Browse the repository at this point in the history
…classes that will not be interfaced for V1
  • Loading branch information
spinach committed Jun 27, 2017
1 parent ba446e4 commit be04629
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 92 deletions.
3 changes: 0 additions & 3 deletions Example/Example/FullDemo/FacetController.swift
Expand Up @@ -15,7 +15,6 @@ class FacetController: UIViewController, RefinementTableViewDataSource {
var instantSearch: InstantSearch!
@IBOutlet weak var refinementList: RefinementTableWidget!
@IBOutlet weak var statLabel: UILabel!
var statLabelController: StatsLabelController!

var refinementController: RefinementController!

Expand All @@ -28,8 +27,6 @@ class FacetController: UIViewController, RefinementTableViewDataSource {

instantSearch = InstantSearch.shared
instantSearch.register(widget: refinementList)
statLabelController = StatsLabelController(label: statLabel)
instantSearch.register(widget: statLabelController)
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath, containing facet: String, with count: Int, is refined: Bool) -> UITableViewCell {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Library/Concrete/View/StatsLabelWidget.swift
Expand Up @@ -37,7 +37,7 @@ import UIKit
}
}

@objc public class StatsLabelController: NSObject, StatsViewDelegate, AlgoliaWidget {
@objc internal class StatsLabelController: NSObject, StatsViewDelegate, AlgoliaWidget {

var label: UILabel

Expand Down
Expand Up @@ -42,11 +42,11 @@ import InstantSearchCore
}

extension RefinementMenuViewModel {
@objc public func getRefinementList(params: SearchParameters,
facetCounts: [String: Int],
andFacetName facetName: String,
transformRefinementList: TransformRefinementList,
areRefinedValuesFirst: Bool) -> [FacetValue] {
@objc internal func getRefinementList(params: SearchParameters,
facetCounts: [String: Int],
andFacetName facetName: String,
transformRefinementList: TransformRefinementList,
areRefinedValuesFirst: Bool) -> [FacetValue] {

let allRefinements = params.buildFacetRefinements()
let refinementsForFacetName = allRefinements[facetName]
Expand Down
2 changes: 1 addition & 1 deletion Sources/Library/Helpers.swift
Expand Up @@ -97,7 +97,7 @@ private func == <T> (lhs: WeakObject<T>, rhs: WeakObject<T>) -> Bool {
return lhs.object === rhs.object
}

public struct WeakSet<T: AnyObject>: Sequence {
internal struct WeakSet<T: AnyObject>: Sequence {

private var _objects: Set<WeakObject<T>>

Expand Down
74 changes: 0 additions & 74 deletions Sources/Library/InstantSearchMultiIndex.swift

This file was deleted.

6 changes: 3 additions & 3 deletions Sources/TestHelpers/FatalError.swift
Expand Up @@ -9,20 +9,20 @@
import Foundation

// overrides Swift global `fatalError`
public func fatalError(_ message: @autoclosure () -> String = "", file: StaticString = #file, line: UInt = #line) -> Never {
internal func fatalError(_ message: @autoclosure () -> String = "", file: StaticString = #file, line: UInt = #line) -> Never {
FatalErrorUtil.fatalErrorClosure(message(), file, line)
unreachable()
}

/// This is a `noreturn` function that pauses forever
public func unreachable() -> Never {
internal func unreachable() -> Never {
repeat {
RunLoop.current.run()
} while (true)
}

/// Utility functions that can replace and restore the `fatalError` global function.
public struct FatalErrorUtil {
internal struct FatalErrorUtil {

// Called by the custom implementation of `fatalError`.
static var fatalErrorClosure: (String, StaticString, UInt) -> Never = defaultFatalErrorClosure
Expand Down
2 changes: 1 addition & 1 deletion Tests/FatalError.swift
Expand Up @@ -7,7 +7,7 @@
//

import Foundation
import InstantSearch
@testable import InstantSearch
import XCTest

extension XCTestCase {
Expand Down
4 changes: 0 additions & 4 deletions instantsearch.xcodeproj/project.pbxproj
Expand Up @@ -57,7 +57,6 @@
E27C16451E9394250091D79E /* SearchBarWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = E27C16391E9394250091D79E /* SearchBarWidget.swift */; };
E27C16461E9394250091D79E /* StatsLabelWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = E27C163A1E9394250091D79E /* StatsLabelWidget.swift */; };
E27C16471E9394250091D79E /* InstantSearch.swift in Sources */ = {isa = PBXBuildFile; fileRef = E27C163B1E9394250091D79E /* InstantSearch.swift */; };
E27C16481E9394250091D79E /* InstantSearchMultiIndex.swift in Sources */ = {isa = PBXBuildFile; fileRef = E27C163C1E9394250091D79E /* InstantSearchMultiIndex.swift */; };
E27C16491E9394250091D79E /* ClearAllWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = E27C163D1E9394250091D79E /* ClearAllWidget.swift */; };
E27C164A1E9394250091D79E /* ActivityIndicatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E27C163E1E9394250091D79E /* ActivityIndicatorView.swift */; };
E27C164B1E9394250091D79E /* RefinableDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E27C163F1E9394250091D79E /* RefinableDelegate.swift */; };
Expand Down Expand Up @@ -157,7 +156,6 @@
E27C16391E9394250091D79E /* SearchBarWidget.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchBarWidget.swift; sourceTree = "<group>"; };
E27C163A1E9394250091D79E /* StatsLabelWidget.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StatsLabelWidget.swift; sourceTree = "<group>"; };
E27C163B1E9394250091D79E /* InstantSearch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InstantSearch.swift; sourceTree = "<group>"; };
E27C163C1E9394250091D79E /* InstantSearchMultiIndex.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InstantSearchMultiIndex.swift; sourceTree = "<group>"; };
E27C163D1E9394250091D79E /* ClearAllWidget.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClearAllWidget.swift; sourceTree = "<group>"; };
E27C163E1E9394250091D79E /* ActivityIndicatorView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ActivityIndicatorView.swift; sourceTree = "<group>"; };
E27C163F1E9394250091D79E /* RefinableDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RefinableDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -431,7 +429,6 @@
E2231E961EC9F5A7002FCF82 /* Constants.swift */,
28F828821C494B2C00330CF4 /* Info.plist */,
E27C163B1E9394250091D79E /* InstantSearch.swift */,
E27C163C1E9394250091D79E /* InstantSearchMultiIndex.swift */,
E27A7BF01E97931E005B2506 /* ViewModelFetcher.swift */,
E2A477001EC61B43007CA367 /* InstantSearch-Bridging-Header.h */,
);
Expand Down Expand Up @@ -764,7 +761,6 @@
E2738FC71E9CC3F8002C002D /* RefinementMenuViewModelDelegate.swift in Sources */,
E2738FCB1E9CDDA0002C002D /* NumericControlViewModelDelegate.swift in Sources */,
E233BC031EBB78B600F5F5E1 /* FacetControlViewModel.swift in Sources */,
E27C16481E9394250091D79E /* InstantSearchMultiIndex.swift in Sources */,
E27C16451E9394250091D79E /* SearchBarWidget.swift in Sources */,
E27A7BEA1E955612005B2506 /* ResettableDelegate.swift in Sources */,
E2738FD21E9D1AFF002C002D /* RefinementListHelper.swift in Sources */,
Expand Down

0 comments on commit be04629

Please sign in to comment.