PromptConfig

public struct PromptConfig : @unchecked Sendable

Encapsulates all customizable configuration for the in-app feedback prompt. Includes localized strings, component styles, and tint colors for both light and dark mode. Conforms to @unchecked Sendable for use across concurrency domains.

  • A default PromptConfig instance with stock strings, styles, and colors.

    Declaration

    Swift

    public static let defaultConfig: PromptConfig
  • Creates a PromptConfig with optional overrides for any subset of its configuration values.

    Declaration

    Swift

    public init(
      ratingStrings: RatingStrings = .init(),
      commentStrings: CommentStrings = .init(),
      storeReviewStrings: StoreReviewStrings = .init(),
      thankYouStrings: ThankYouStrings = .init(),
      submitButton: PromptConfig.Button = .init(),
      commentField: PromptConfig.TextField = .init(),
      tintColor: Color = .blue,
      tintColorDark: Color = .blue
    )

    Parameters

    ratingStrings

    Strings for the rating step.

    commentStrings

    Strings for the comment step.

    storeReviewStrings

    Strings for the store review step.

    thankYouStrings

    Strings for the thank-you step.

    submitButton

    Style for the submit button.

    commentField

    Style for the comment text field.

    tintColor

    Accent color for light mode.

    tintColorDark

    Accent color for dark mode.

  • Returns a copy of this configuration with selectively overridden values.

    Declaration

    Swift

    public func copy(
      ratingStrings: RatingStrings? = nil,
      commentStrings: CommentStrings? = nil,
      submitButton: PromptConfig.Button? = nil,
      commentField: PromptConfig.TextField? = nil,
      tintColor: Color? = nil,
      tintColorDark: Color? = nil
    ) -> PromptConfig

    Return Value

    A new PromptConfig with updated fields.

  • Configuration for the comment text field’s shape, variant, and size.

    See more

    Declaration

    Swift

    public struct TextField
  • Configuration for the prompt’s submit button shape, variant, and size.

    See more

    Declaration

    Swift

    public struct Button
  • Localized strings for the rating step of the prompt.

    See more

    Declaration

    Swift

    public struct RatingStrings
  • Localized strings for the comment step of the prompt.

    See more

    Declaration

    Swift

    public struct CommentStrings
  • Localized strings for the App Store review prompt step.

    See more

    Declaration

    Swift

    public struct StoreReviewStrings
  • Localized strings for the final thank-you screen.

    See more

    Declaration

    Swift

    public struct ThankYouStrings