Skip to content
This repository was archived by the owner on Jan 19, 2025. It is now read-only.

Commit bbbec1b

Browse files
committed
Fix
1 parent d470f52 commit bbbec1b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/posts/2023-06-30-swiftui-text-concatenation.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11

22
---
3-
title: "SwiftUI and the Text contatenations super powers"
4-
description: "Do you need a way to compose beautiful text with images and custom font like you are used with Attributed String. The Text component has eveything we need to create some sort of 'attributed text' directly in SwiftUI. Let's go!!!"
5-
date: 2023-06-30
3+
title: "SwiftUI and the Text concatenations super powers"
4+
description: "Do you need a way to compose beautiful text with images and custom font like you are used with
5+
Attributed String. The Text component has everything we need to create some sort of 'attributed text' directly in SwiftUI. Let's go!!!"
6+
date: 2023-06-12
67
image: ../images/posts/swiftui-five-stars.png
78
tags: [swift, swiftui, ios, apple, mobile-application-development]
89
comments: true
@@ -19,7 +20,9 @@ represented by a number of stars matching the rating itself.
1920
![The layout of the hotel widget](../images/posts/swiftui-hotel-layout.png)
2021

2122
From iOS 15 the `Text` supports the new `AttributedString` from the `Foundation` framework as a parameter. But... given that the ne AttributedString are not always [easy to use](https://stackoverflow.com/questions/75513158/how-do-you-add-an-image-attachment-to-an-attributedstring) and we wanted a more "SwiftUI native" way to create our custom text, we wondered if there was another way to do our implementation.
22-
Luckily we discovered that in SwiftUI the `+` is overloaded and does some incredible magic :crystal_ball:. It basically concates each `Text` content while keeping each own specific formatting :scream:. It's like having Attributed Strings directly implemented in SwiftUI :rocket:.
23+
Luckily we discovered that in SwiftUI the `+` is overloaded and does some incredible magic :crystal_ball:. It
24+
basically concatenates each `Text` content while keeping each own specific formatting :scream:. It's like having
25+
Attributed Strings directly implemented in SwiftUI :rocket:.
2326
After this discovery, we were ready to implement our own custom layout above. So let's no longer wait and jump into the implementation right now!!! :rocket:
2427

2528

0 commit comments

Comments
 (0)