From 79ab617b060b8950f535eb822992f0a65478a2fb Mon Sep 17 00:00:00 2001 From: Ian Wagner Date: Sun, 8 Sep 2024 03:36:28 +0900 Subject: [PATCH] Fix Docc landing page --- README.md | 2 +- .../StadiaMapsAutocompleteSearch.md | 29 ++++++++++++++++++ .../Documentation.docc/screenshot.png | Bin 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 Sources/StadiaMapsAutocompleteSearch/Documentation.docc/StadiaMapsAutocompleteSearch.md rename screenshot.png => Sources/StadiaMapsAutocompleteSearch/Documentation.docc/screenshot.png (100%) diff --git a/README.md b/README.md index 50f2eb2..d820d94 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ This package helps you easily add geographic autocomplete search to a SwiftUI ap * Can bias search results to be nearby a specific location * Automatically localizes place names based on the user's device settings (where available) -![Screenshot](screenshot.png) +![Screenshot](Sources/StadiaMapsAutocompleteSearch/Documentation.docc/screenshot.png) ## Installation diff --git a/Sources/StadiaMapsAutocompleteSearch/Documentation.docc/StadiaMapsAutocompleteSearch.md b/Sources/StadiaMapsAutocompleteSearch/Documentation.docc/StadiaMapsAutocompleteSearch.md new file mode 100644 index 0000000..58c920f --- /dev/null +++ b/Sources/StadiaMapsAutocompleteSearch/Documentation.docc/StadiaMapsAutocompleteSearch.md @@ -0,0 +1,29 @@ +# ``StadiaMapsAutocompleteSearch`` + + +## Overview + +This package helps you easily add geographic autocomplete search to a SwiftUI app. +It supports most use cases out of the box, and is easily extensible to create a tailored design. + +* Displays a search box and list which you can embed in other views +* Provides a callback handler with the result details when users tap a result +* Can bias search results to be nearby a specific location +* Automatically localizes place names based on the user's device settings (where available) + +![Screenshot](screenshot) + +## Quickstart + +First, you'll need a Stadia Maps API key. +Create one for free [here](https://client.stadiamaps.com/signup/?utm_source=spm&utm_campaign=sdk_readme&utm_content=swiftui_autocomplete_landing). + +Then, add it to your SwiftUI view like this: + +```swift +AutocompleteSearch(apiKey: previewApiKey, onResultSelected: { selection in + // TODO: Selection logic +}) +``` + +Refer to the ``AutocompleteSearch`` documentation for more details on customization. diff --git a/screenshot.png b/Sources/StadiaMapsAutocompleteSearch/Documentation.docc/screenshot.png similarity index 100% rename from screenshot.png rename to Sources/StadiaMapsAutocompleteSearch/Documentation.docc/screenshot.png