Skip to content

Commit 129da72

Browse files
authored
Merge pull request #1 from harflabs/release/1.1
Release 1.1
2 parents 02b3120 + 4fb5769 commit 129da72

4 files changed

Lines changed: 1211 additions & 95 deletions

File tree

Package.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ let package = Package(
1919
targets: [
2020
.target(
2121
name: "MarqueeText"
22+
),
23+
.testTarget(
24+
name: "MarqueeTextTests",
25+
dependencies: ["MarqueeText"]
2226
)
2327
]
2428
)

README.md

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ A lightweight SwiftUI component that automatically creates marquee scrolling ani
55
## Features
66

77
- 🎯 **Automatic Detection** - Only scrolls when text overflows
8-
- ⚡️ **Smooth Animations** - Customizable timing and easing
8+
- ⚡️ **Smooth Animations** - Customizable duration, delay, and spacing
99
- 🎨 **SwiftUI Native** - Built with pure SwiftUI
10-
- ♿️ **Accessible** - Full accessibility support
11-
- ↔️ **Localizable** - Supports `LocalizedStringResource` and right to left layouts.
10+
- ♿️ **Accessible** - VoiceOver-friendly labels with Reduce Motion support
11+
- ↔️ **Localizable** - Supports `LocalizedStringResource` and right-to-left layouts
1212
- 📱 **Multi-Platform** - iOS, macOS, tvOS, and visionOS
1313

1414
## Requirements
@@ -26,7 +26,7 @@ Add the following to your `Package.swift` file:
2626

2727
```swift
2828
dependencies: [
29-
.package(url: "https://github.com/harflabs/MarqueeText.git", from: "1.0.0")
29+
.package(url: "https://github.com/harflabs/MarqueeText.git", from: "1.1.0")
3030
]
3131
```
3232

@@ -45,6 +45,25 @@ import MarqueeText
4545
MarqueeText("This is a long text that will scroll smoothly across the screen!")
4646
```
4747

48+
String literals use SwiftUI's localized string resource behavior. For runtime strings, such as titles from an API,
49+
you can pass a `String` value directly or use the explicit verbatim initializer when you want to make that intent
50+
clear:
51+
52+
```swift
53+
let title = "Now Playing: Bohemian Rhapsody - Queen"
54+
55+
MarqueeText(title)
56+
MarqueeText(verbatim: title)
57+
```
58+
59+
### Layout Behavior
60+
61+
`MarqueeText` measures the rendered text and available width, so short text stays static and overflowing text scrolls.
62+
It remeasures when SwiftUI layout changes, including font, Dynamic Type, locale, and container size updates. This keeps
63+
the marquee responsive in lists, stacks, compact controls, and during device rotation.
64+
65+
Right-to-left layout direction mirrors the marquee alignment and scroll direction.
66+
4867
### Custom Timing
4968

5069
```swift
@@ -56,6 +75,8 @@ MarqueeText(
5675
)
5776
```
5877

78+
Invalid duration, delay, and spacing values are clamped to safe defaults.
79+
5980
### With Styling
6081

6182
```swift
@@ -70,6 +91,22 @@ MarqueeText("Styled marquee text")
7091
)
7192
```
7293

94+
### Accessibility
95+
96+
`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.
98+
99+
## Testing
100+
101+
Run the regression suite with:
102+
103+
```bash
104+
swift test --enable-code-coverage
105+
```
106+
107+
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.
109+
73110
## Examples
74111

75112
### Main Showcase

0 commit comments

Comments
 (0)