SizeGuideButton (UIKit)
The same button as a UIView. Auto Layout sizes it from its content. product, variant, label and onRecommendation can be changed later.
public init(client: TryYourSize, product: String, variant: SizeGuide.Variant = .link, label: String? = nil)Parameters
Section titled “Parameters”clientTryYourSizeRequiredYour client.
productStringRequiredYour product ID or SKU.
variantSizeGuide.VariantOptional= .linklabelString?Optional= nilExample
Section titled “Example”// UIKitlet guide = SizeGuideButton(client: tys, product: "SKU-123", variant: .button)guide.onRecommendation = { rec in /* … */ }stack.addArrangedSubview(guide)// Viewsval guide = SizeGuideView(context).apply { client = tys product = "SKU-123" variant = SizeGuideVariant.BUTTON onRecommendation = { rec -> /* … */ }}Was this page helpful?
Thank you. We read every answer.