Skip to content

Commit

Permalink
Adjust label extension
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsaidi committed Apr 29, 2024
1 parent a80772c commit ad529f1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ SwiftUIKit makes its best effort to honor semver, but breaking changes can occur



## 4.2.3

### 💡 Behavior changes

* `Label` now used `LocalizedStringKey` for its title.



## 4.2.2

### 🐛 Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftUIKit/Extensions/Label+Init.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import SwiftUI
public extension Label where Icon == Image, Title == Text {

/// Create a label with a string and a plain image icon.
init(_ text: String, image: Image) {
init(_ text: LocalizedStringKey, image: Image) {
self.init {
Text(text)
} icon: {
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftUIKit/Lists/ListButtonGroup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private extension ButtonStyle where Self == ListButtonGroupStyle {
private extension String {

func previewButton(_ icon: Image) -> some View {
Button {} label: { Label(self, image: icon) }
Button {} label: { Label(LocalizedStringKey(self), image: icon) }
}
}

Expand Down

0 comments on commit ad529f1

Please sign in to comment.