-
-
Notifications
You must be signed in to change notification settings - Fork 569
Open
Description
I want to use MarqueeLabel within SwiftUI views.
But I could not work it using the code below.
How do I implement it?
import SwiftUI
import MarqueeLabel
struct MarqueeText: UIViewRepresentable {
func makeUIView(context: Context) -> MarqueeLabel {
MarqueeLabel(frame: .init(x: 0, y: 0, width: 100, height: 24), duration: 1.0, fadeLength: 10.0)
}
func updateUIView(_ uiView: MarqueeLabel, context: Context) {
uiView.textAlignment = .center
uiView.text = "The quick brown fox jumps over the lazy dog."
uiView.restartLabel()
}
}
// MARK: - Preview
struct MarqueeText_Previews: PreviewProvider {
static var previews: some View {
MarqueeText()
}
}Metadata
Metadata
Assignees
Labels
No labels