Back to Browse

Styling SwiftUI Text Views

4.0K views
May 7, 2023
20:43

In this video we are going to explore how we can stylize text for our Text views in SwiftUI. We will start by looking at how we can create a `Text` view with the Markdown-formatted base language version of the string as the localization key, We will also see how we can utilize string interpolation to combine and stylize our strings and present them in a text view. And finally, we will take a quick look at the power of Attributed strings in SwiftUI. If you want to support my work, you can buy me a coffee :) https://ko-fi.com/stewartlynch Table of Contents: 0:00 Introduction 1:30 Styling with MarkDown 7:42 String Interpolation 12:25 AttributedStrings Starter Project Files: (If you are having problems downloading zip files, use Safari. Chrome restricts zip files by default) https://www.createchsol.com/StarterProjects/TextViewStylingStarter.zip Completed Project: https://github.com/StewartLynch/TextView-Styling References mentioned in video: Markdown rendering using Text in SwiftUI - SwiftLee https://www.avanderlee.com/swiftui/markdown-text/?utm_campaign=coschedule&utm_source=twitter&utm_medium=twannl&utm_content=Markdown%20rendering%20using%20Text%20in%20SwiftUI) Swift: A Simple Way To Work With Attributed Strings | by Alexander Martirosov | Medium https://alexxjk-mr.medium.com/swift-a-simple-way-to-work-with-attributed-strings-590e24fbea08 Text modifiers in SwiftUI https://nilcoalescing.com/blog/TextModifiersInSwiftUI/ Markdown Guide for Developers. Markdown is a powerful conversational… | by Cesar William Alvarenga | Better Programming https://betterprogramming.pub/markdown-guide-for-developers-6d44f1633cbe) Attributed Strings with SwiftUI - The SwiftUI Lab https://swiftui-lab.com/attributed-strings-with-swiftui/ Formatting interpolated strings in SwiftUI - a free SwiftUI by Example tutorial https://www.hackingwithswift.com/quick-start/swiftui/formatting-interpolated-strings-in-swiftui How to add advanced text styling using AttributedString - a free SwiftUI by Example tutorial https://www.hackingwithswift.com/quick-start/swiftui/how-to-add-advanced-text-styling-using-attributedstring) Other References: Stewart Lynch's YouTube Channel: https://youtube.com/@StewartLynch Stewart Lynch on Mastodon: https://iosdev.space/@StewartLynch Stewart Lynch on Twitter: https://twitter.com/StewartLynch Stewart Lynch on LinkedIn https://www.linkedin.com/in/stewartlynch

Download

0 formats

No download links available.

Styling SwiftUI Text Views | NatokHD