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
).uiViewParameters
Required props
| Name | Type | Default | Description |
|---|---|---|---|
| text | String | Text that will be shown in the broadcast | |
| broadcastEdge | Warp.BroadcastEdge | Edge from where the broadcast is presented. Use one of the predefined BroadcastEdge values: .top, or .bottom | |
| isPresented | Binding Bool | Binding to a boolean value that allows the broadcast to control dismissal |
Optional Props
| Name | Type | Default | Description |
|---|---|---|---|
| isDismissable | Bool | true | Determines 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