Member-only story
Text Scroll using SwiftUI
Like Star Wars? Done!
2 min readJun 25, 2020
Imagine that you want to create a scrolling view Star-Wars style. Well, Imagine no longer!
Difficulty: **Beginner** | Easy | Normal | Challenging<br/>
This article has been developed using Xcode 11.5, and Swift 5.2.4
Prerequisites:
- Be able to produce a “Hello, World!” Swift application
- Be able to produce a “Hello, World” SwiftUI application
The example
This example is a nice one about how to scroll text up the screen in SwiftUI
using instance methods on the Text
struct.
That one thing
To find out the height of the device I used GeometryReader
which is wrapped around the Text
view.
That’s enough!
Let us see the code, let us see the code. Ok: here it is.