1 min read
Get Started
Last Updated - Platform 22.0 - SDK 17.0The Swipe to Like (S2L) feature uses the Search API to provide swipeable card based wishlisting. It does not support Variant level wishlisting out of the box, but will work if you customise the Wishlist button to show the Variant Selector.
Set up the Swipe to Like screen
- Ensure the SDK and Platform are set up following the PoqSDK set up steps.
- Add the
PoqSwipeToLike
framework to your project following these steps.
This is all the code you need to be able to deeplink to the Swipe to Like screen. To have it as a tab continue to the next section.
Replace a tab with Swipe to Like
By default Swipe to Like is only accessible via deeplinks but it does set itself up with the swipetolike
tab alias.
The features presented by the 5 tabs are determined from the MightyBot settings tab1
through tab5
.
- Open MightyBot and login with your account (ask your contact for access and the link).
- Edit your app on the Apps page then edit your next (unreleased) app version.
- Navigate to the Config tab and search for
tab{1-5}
with the tab index to replace. - Copy or edit the
tab{1-5}
config. - Set the iPhone value to
swipetolike
(iPad defaults to this so you can leave it blank). - Make the option Exportable then tap Save.
Assuming your app is using the modified version, if you run your app now the Swipe to Like feature will be visible as a tab.
But it's content may not be what you want.
To use a specific category you can set the default ProductListSource
via the coordinator.
- Open your
AppModule
to thedidAddToPlatform
orsetUpSwipeToLike
function. - Customise the default
PoqSwipeToLikeCoordinator
specifying the default source.
Container.shared.coordinators.swipeToLike.replace { // Example using a category named 'swipe-to-like'. PoqSwipeToLikeCoordinator(source: .init(method: .category("swipe-to-like")))}
Replace the Cart tab
A common customisation replaces the Cart tab with Swipe to Like, moving the Cart button to the navigation bar.
This can be done with any tab by setting a custom navigationBarButtonItem
but the Cart has additional badge logic.
- Open your
AppModule
to thedidAddToPlatform
orsetUpCart
function. - Inject the
CartNavigationBarButtonItem
as the app-wide navigation bar button.
Container.shared.views.navigationBarButtonItem = .factory { .cart }
This button can be customised or moved anywhere within your app. See the navigation button customisation docs for further details.