Skip to main content
Version: 12.10.0

Tost Component

The toast item Component is a reusable view that allows you to create customisable toast with different items, such as text, image icon and button. A toast message in iOS is a small, short-lived popup that provides a small bite of information to the users..

Features

  • Update title text, image icons and primary, secondary buttons.
  • Interact with toast using buttons.

Installation

  1. Copy the Toast component folder into your Xcode project.

  2. Use the OCToastView view in your SwiftUI code:

import SwiftUI

struct ContentView: View {
let primaryButton = Button()
let secondaryButton = Button()
var body: some View {
VStack {
OCToast(title: "Multiline message with action.", iconImage: .iconImage, toastType: .normal, primaryButton: primaryButton, secondaryButton: secondaryButton, isButtonPositionAtCenter: false)
}
}
}