You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If this is your first time using Carthage in the project, you'll need to go through some additional steps as explained [over at Carthage](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application).
114
105
106
+
You can now import the Algolia API client in your project and play with it.
115
107
116
-
## 💡 Getting Started
117
-
118
-
### Initialize the client
119
-
120
-
To start, you need to initialize the client. To do this, you need your **Application ID** and **API Key**.
121
-
You can find both on [your Algolia account](https://www.algolia.com/api-keys).
108
+
> Import the Core package and the required client package to your source code files:
122
109
123
110
```swift
124
-
let client =SearchClient(applicationID: applicationID, apiKey: apiKey)
125
-
```
126
-
127
-
### Push data
128
-
129
-
Without any prior configuration, you can start indexing contacts in the `contacts` index using the following code:
You can now search for contacts by `firstname`, `lastname`, `company`, etc. (even with typos):
153
-
154
-
```swift
155
-
let searchParams =SearchParamsObject(query: "Jimmy")
156
-
157
-
let res =tryawait client.searchSingleIndex(indexName: "contacts", searchParams: .searchParamsObject(searchParams))
158
-
159
-
dump(res.hits[0])
160
-
```
161
-
162
-
### Configure
111
+
#ifcanImport(Core)
112
+
importCore
113
+
#endif
114
+
importSearch
163
115
164
-
Settings can be customized to tune the search behavior. For example, you can add a custom sort by number of followers to the already great built-in relevance:
116
+
let client =trySearchClient(appID: "YOUR_APP_ID", apiKey: "YOUR_API_KEY")
165
117
166
-
```swift
167
-
let indexSettings =IndexSettings(customRanking: ["desc(followers)"])
For full documentation, visit the [Algolia's API Clients Automation documentation](https://api-clients-automation.netlify.app/docs/clients/introduction).
182
-
183
-
## 📝 Examples
184
-
185
-
You can find code samples in the [Algolia's API Clients Automation guides](https://api-clients-automation.netlify.app/docs/clients/guides/send-data-to-algolia).
186
-
187
-
## Contributing to this repository
188
-
189
-
The Algolia API clients are automatically generated, you can find everything here https://github.com/algolia/api-clients-automation
190
-
191
-
## 📄 License
192
-
193
-
Algolia Swift API Client is an open-sourced software licensed under the [MIT license](LICENSE).
136
+
For full documentation, visit the **[Algolia Swift API Client](https://www.algolia.com/doc/api-client/getting-started/install/swift/)**.
194
137
195
138
## Notes
196
139
@@ -212,8 +155,14 @@ You can use the old library with Swift by one of the following ways:
Encountering an issue? Before reaching out to support, we recommend heading to our [FAQ](https://www.algolia.com/doc/api-client/troubleshooting/faq/swift/) where you will find answers for the most common issues and gotchas with the client. You can also open [a GitHub issue](https://github.com/algolia/api-clients-automation/issues/new?assignees=&labels=&projects=&template=Bug_report.md)
161
+
162
+
## Contributing
163
+
164
+
This repository hosts the code of the generated Algolia API client for Swift, if you'd like to contribute, head over to the [main repository](https://github.com/algolia/api-clients-automation). You can also find contributing guides on [our documentation website](https://api-clients-automation.netlify.app/docs/contributing/introduction).
165
+
166
+
## 📄 License
216
167
217
-
-**Need help**? Ask a question to the [Algolia Community](https://discourse.algolia.com/) or on [Stack Overflow](http://stackoverflow.com/questions/tagged/algolia).
218
-
-**Encountering an issue?** Before reaching out to support, we recommend heading to our [FAQ](https://www.algolia.com/doc/api-client/troubleshooting/faq/swift/) where you will find answers for the most common issues and gotchas with the client.
219
-
-**Found a bug?** You can open a [GitHub issue](https://github.com/algolia/algoliasearch-client-swift/issues).
168
+
The Algolia Swift API Client is an open-sourced software licensed under the [MIT license](LICENSE).
0 commit comments