Skip to content

Broadcast - Frameworks

Broadcast automatically fetches broadcast messages for the current (or a given) url.

iOSreleased

iOS

Syntax

swift
Warp.Broadcast(
    text: String,
    broadcastEdge: Warp.BroadcastEdge,
    isDismissable: Bool = true,
    isPresented: Binding<Bool>
)

You can create the Broadcast yourself or add it as a modifier to your view.

swift
Warp.Broadcast(
    text: "Broadcast",
    broadcastEdge: .top,
    isPresented: $broadcastIsPresented
)

.warpBroadcast(
    text: "Here's a broadcast located at the bottom edge",
    edge: .bottom,
    isDismissable: false,
    isPresented: $broadcastIsPresented
)

There are a variety of positions supported for the broadcast component:

swift
enum Warp.BroadcastEdge {
    case top
    case bottom
}

Legacy support

By default all Warp components return a SwiftUI View but there is always a UIKit UIView available to use also.

swift
Warp.Broadcast(
    text: "Broadcast",
    broadcastEdge: .top,
    isPresented: $broadcastIsPresented
).uiView

Parameters

Required props

NameTypeDefaultDescription
textStringText that will be shown in the broadcast
broadcastEdgeWarp.BroadcastEdgeEdge from where the broadcast is presented. Use one of the predefined BroadcastEdge values: .top, or .bottom
isPresentedBinding BoolBinding to a boolean value that allows the broadcast to control dismissal

Optional Props

NameTypeDefaultDescription
isDismissableBooltrueDetermines if dismissable by the user or not. Will add a close button.

Questions?

Feel free to ask any questions on usage in the Warp DS Slack channel: #warp-design-system