iOS
Signature
Explore example code
Browse the Loading example code on GitHub.
About this widget
Components that show a loading indicator during pending requests.Examples
Instantiate aLoadingConnector.
Swift
Parameters
The business logic that handles showing a loading indicator.
Controller that interfaces with a concrete loading view.
Low-level API
If you want to fully control the loading indicator components and connect them manually, you can use these components. The loading indicator consists of the following components:Searcher. TheSearcherthat handles your searches.LoadingInteractor. The logic that handles showing a loading indicatorLoadingController. The controller that interfaces with a concrete loading indicator.
Swift
Customizing your view
The default controllers, such asActivityIndicatorController,
work well when you want to use native UIKit with their default behavior like UIActivityIndicatorView.
If you want to use another component such as a third-party view,
or want to introduce some custom behavior to the already provided UIKit components,
you can create your own controller conforming to the LoadingController protocol.
Protocol
Swift
Example
Swift
SwiftUI
InstantSearch provides theLoadingObservableController data model,
which is an implementation of the LoadingController protocol adapted for usage with SwiftUI.
LoadingObservableController must be connected to the LoadingConnector or LoadingConnector like any other LoadingController implementation.
The example of the loading view using the ProgressView component provided by SwiftUI.
Swift
LoadingObservableController as a data model.
It provides the isLoading property to streamline the design process of your custom SwiftUI view.