MarketEdge View UI Guide
The Entrupy iOS SDK provides displayMarketEdgeViewForItem(withEntrupyID:withConfiguration:) to present the SDK's built-in MarketEdge screen for an authentication result. The screen shows MarketGrade, MarketValue, MarketMatch, disclaimer, and optional region selection. The SDK owns the screen and its lifecycle; your app provides the Entrupy ID and visibility configuration.
Overview
- Presents a full-screen MarketEdge experience (MarketGrade, MarketValue, MarketMatch, region) hosted by the SDK.
- You control which sections are visible via
EntrupyMarketEdgeViewConfiguration. - Lifecycle and user actions are reported through
EntrupyMarketEdgeViewDelegate.
Before presenting the MarketEdge view:
- Initialize the SDK and ensure
entrupyApp.isAuthorizationValid()returnstrue. - Have the target authentication’s
entrupy_idavailable. - Implement
EntrupyMarketEdgeViewDelegateon the presenting view controller (or another object you assign as the delegate).
Presenting the MarketEdge View
import EntrupySDK
final class YourViewController: UIViewController, EntrupyMarketEdgeViewDelegate {
func presentMarketEdge(for entrupyID: String) {
guard EntrupyApp.sharedInstance().isAuthorizationValid() else {
print("User not authorized. Cannot display MarketEdge view.")
return
}
let configuration = EntrupyMarketEdgeViewConfiguration(
displayMarketGrade: true,
displayMarketValue: true,
displayMarketMatch: true,
displayRegionSelection: true
)
EntrupyApp.sharedInstance().marketEdgeViewDelegate = self
EntrupyApp.sharedInstance().displayMarketEdgeViewForItem(withEntrupyID: entrupyID, withConfiguration: configuration)
}
// MARK: - EntrupyMarketEdgeViewDelegate
func didDisplayMarketEdgeViewForItem(withEntrupyID entrupyID: String) {
// SDK presented the view
}
func didDismissMarketEdgeViewForItem(withEntrupyID entrupyID: String) {
// User closed the view
}
func didDisplayMarketEdgeViewFailWithError(
_ errorCode: EntrupyErrorCode,
description: String,
localizedDescription: String,
forEntrupyID entrupyID: String
) {
// Failed to present (e.g. auth, network, invalid ID)
}
}
The SDK presents and dismisses the view; your app does not push or pop view controllers for this screen.
EntrupyMarketEdgeViewConfiguration
| Property | Type | Default | Meaning |
|---|---|---|---|
displayMarketGrade | Bool | true | Show MarketGrade section. Details about the item's condition, a condition rating, and an item report. |
displayMarketValue | Bool | true | Show MarketValue section. Best estimate of the item's value based on recent market data. |
displayMarketMatch | Bool | true | Show MarketMatch section. Recent marketplace listings similar to the submitted item. |
displayRegionSelection | Bool | true | Show region selection for market data. |
- Default:
EntrupyMarketEdgeViewConfiguration()— all sections visible.
Delegate callback summary
| Callback | When it fires |
|---|---|
didDisplayMarketEdgeViewForItem() | The MarketEdge view was presented. |
didDismissMarketEdgeViewForItem() | The user closed the view. |
didDisplayMarketEdgeViewFailWithError() | The view failed to present (e.g. auth, network, invalid ID). |
Related topics
- Understanding MarketEdge in the SDK — data model overview for MarketGrade, MarketValue, MarketMatch, disclaimer, and errors.
- Fetch MarketEdge for Item — programmatic fetch when you need MarketEdge data in your own UI or business logic.
- Detail View Controller — give users a path from item details to MarketEdge.