Created
June 29, 2021 09:55
-
-
Save novinfard/4a9c569eb050a2e1992e0d5824e73c75 to your computer and use it in GitHub Desktop.
[Correct RTL layout in SwiftUI]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct BlogView: View { | |
let text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." | |
var body: some View { | |
VStack(spacing: 16) { | |
Text("Blog Title") | |
.font(.title) | |
Text(text) | |
// Correct Pattern for the Right-to-Left layout | |
HStack { | |
Text("2 June 2021") | |
.font(.caption) | |
Spacer() | |
} | |
Spacer() | |
} | |
.padding(16) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment