Fix build with Swift 5.8 (#986)

Non optionals in if let don't work on the latest Xcode Beta
This commit is contained in:
Thomas Durand 2023-02-22 07:04:37 +01:00 committed by GitHub
parent 0011b25a1c
commit ded5bea4ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View file

@ -31,7 +31,8 @@ struct SideBarView<Content: View>: View {
ZStack(alignment: .topTrailing) {
SideBarIcon(systemIconName: tab.iconName,
isSelected: tab == selectedTab)
if let badge = badgeFor(tab: tab), badge > 0 {
let badge = badgeFor(tab: tab)
if badge > 0 {
makeBadgeView(count: badge)
}
}

View file

@ -188,12 +188,11 @@ struct SettingsTabs: View {
Label {
Text("settings.app.icon")
} icon: {
if let icon = IconSelectorView.Icon(string: UIApplication.shared.alternateIconName ?? "AppIcon") {
Image(uiImage: .init(named: icon.iconName)!)
.resizable()
.frame(width: 25, height: 25)
.cornerRadius(4)
}
let icon = IconSelectorView.Icon(string: UIApplication.shared.alternateIconName ?? "AppIcon")
Image(uiImage: .init(named: icon.iconName)!)
.resizable()
.frame(width: 25, height: 25)
.cornerRadius(4)
}
}
}