You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix layout parity with Text, cut per-row cost, and add CI
MarqueeText reported a hard-coded 20pt height on the first layout pass,
so any font whose line height was not 20pt resized one frame after
appearing — row jitter and scroll drift in List and LazyVStack. Sizing
now comes from the layout, which is correct on the first pass and never
changes as measurement settles.
Also fixes:
- Height followed the proposal instead of the text, so a generous
proposal stretched the view like Color rather than Text.
- clipped() cut glyph overhang. Arabic diacritics, emoji and tall
accents paint outside the line box and Text renders them, so clipping
is now horizontal only.
- Overflowing text that could not scroll (Reduce Motion) was clipped
mid-glyph with no truncation indicator. It now truncates like Text.
- Baselines were not forwarded, so firstTextBaseline stacks misaligned.
- Content identity used String(describing:) on LocalizedStringResource,
a Mirror dump, on every body evaluation.
- The measurement preference could silently drop a real measurement, and
could not be cleared once the text became empty.
Performance: the view laid the text out twice, once hidden purely to
measure it, and ran a second geometry reader for the container width.
Both values are already known to the layout, so it now reports them by
proposing them as the size of a single weightless probe. Measured over
200 rows: 0.755 -> 0.577 ms/row for overflowing text, 0.429 -> 0.264
ms/row for text that fits.
Declares watchOS 9 support, which previously worked only by SPM
inferring the floor from the APIs used.
Adds a Tests workflow (lint, coverage, and a build matrix across all five
declared platforms), Codecov configuration, a SwiftLint config, and
badges. Source and tests are split into focused files.
A lightweight SwiftUI component that automatically creates marquee scrolling animations when text overflows its container. Perfect for music players, news tickers, status displays, and more.
4
10
5
11
## Features
@@ -9,14 +15,15 @@ A lightweight SwiftUI component that automatically creates marquee scrolling ani
9
15
- 🎨 **SwiftUI Native** - Built with pure SwiftUI
10
16
- ♿️ **Accessible** - VoiceOver-friendly labels with Reduce Motion support
11
17
- ↔️ **Localizable** - Supports `LocalizedStringResource` and right-to-left layouts
12
-
- 📱 **Multi-Platform** - iOS, macOS, tvOS, and visionOS
18
+
- 📱 **Multi-Platform** - iOS, macOS, tvOS, visionOS, and watchOS
13
19
14
20
## Requirements
15
21
16
22
- iOS 16.0+
17
23
- macOS 13.0+
18
24
- tvOS 16.0+
19
25
- visionOS 1.0+
26
+
- watchOS 9.0+
20
27
21
28
## Installation
22
29
@@ -26,7 +33,7 @@ Add the following to your `Package.swift` file:
`MarqueeText` exposes a single accessibility label for the full text. When Reduce Motion is enabled, overflowing
97
-
text is shown without the continuous marquee animation.
131
+
`MarqueeText` exposes a single accessibility label for the full text, carrying the static text trait.
132
+
133
+
When Reduce Motion is enabled, overflowing text does not scroll. It truncates with an ellipsis exactly like `Text`,
134
+
so the label still reads as deliberately shortened rather than being cut off mid glyph. The full string remains
135
+
available to VoiceOver through the accessibility label.
98
136
99
137
## Testing
100
138
@@ -105,7 +143,8 @@ swift test --enable-code-coverage
105
143
```
106
144
107
145
The test suite covers overflow detection, text and layout updates, right-to-left layout, Reduce Motion, invalid sizing
108
-
inputs, and redraw-heavy animation timing.
146
+
inputs, redraw-heavy animation timing, seamless loop continuity, and size and baseline parity with `Text` measured
147
+
through a real hosting view.
109
148
110
149
## Examples
111
150
@@ -142,7 +181,6 @@ inputs, and redraw-heavy animation timing.
142
181
143
182
## Apps Using MarqueeText
144
183
145
-
-[Casti - Your Personalized Podcasts, Powered by AI](https://apps.apple.com/app/id6746376736)
146
184
-[Tilfaz - Live & On-Demand TV](https://apps.apple.com/app/id1668359578)
147
185
148
186
*Add your app here! Submit a pull request to include your app.*
@@ -159,4 +197,4 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
159
197
160
198
This library is built by [Harf Labs](https://harflabs.com), a software development company that creates solutions for real problems.
161
199
162
-
If you like this project and need help with your own software projects, we'd love to hear from you! [Get in touch](https://harflabs.com/en/contact) and let's build something amazing together.
200
+
If you like this project and need help with your own software projects, we'd love to hear from you! [Get in touch](https://harflabs.com/en/#contact) and let's build something amazing together.
0 commit comments