⚠️ This repository is deprecated ⚠️
We are no longer maintaining an iOS library for Site Search. However, you can still build excellent native and mobile web experiences with Site Search APIs and clients. Thank you! - Elastic
A first-party iOS library to add Elastic Site Search to iOS applications.
git clone git@github.com:swiftype/SwiftypeTouch.git
) and copy the top-level SwiftypeTouch
directory to the directory that contains YourProject.xcodeproj
(or use a git submodule).SwiftypeTouch/SwiftypeTouch.xcodeproj
to your Xcode project.
SwiftypeTouch.xcodeproj
into the project browser from Finder.YourProject.xcodeproj
Build Settings add to your HEADER_SEARCH_PATHS
the following: $(SRCROOT)/SwiftypeTouch/
.-ObjC
and -all_load
to your project's OTHER_LDFLAGS
.libSwiftypeTouch.a
with your target. Under your Target settings go to Build Phases. Expand "Link Binary With Libraries" hit the "+" button and select libSwiftypeTouch.a
from the dialog.You are now ready to use SwiftypeTouch in your project.
Note: This client has been developed for the Swiftype Site Search API endpoints only. You may refer to the Swiftype Site Search API Documentation for additional context.
If your Swiftype search engine was created with the Swiftype crawler, you can follow these steps to quickly add search that displays results in a table view. Results will load in a webview when selected.
#import <SwiftypeTouch/STPageDocumentTypeResultsObject.h>
to the view controller implementation that will place the search bar on the screen.STPageDocumentTypeResultsObject
called resultObject
in your view controller:
@property (nonatomic, strong) STPageDocumentTypeResultsObject *resultObject;
viewDidLoad
add the following code to get the search bar to appear: self.resultObject = [[STPageDocumentTypeResultsObject alloc] initWithViewController:self clientEngineKey:@"yourEngineKey"];
[self.view addSubview:self.resultObject.searchBar];
To see an example of this, view the source of the SwiftypeTouchExample application.
If something is not working as expected, please open an issue.
Your best bet is to read the documentation.
You can checkout the Elastic Site Search community discuss forums.
We welcome contributors to the project. Before you begin, a couple notes...
Thank you to all the contributors!