mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
[iOS] Reduced Project Warnings
- Unused code has been removed (`InteractiveLabel`) - `NavigationLink` code updated - `Async` alternative used for UNUserNotificationCenter - iOS target update to 16 to remove Storyboard related warnings
This commit is contained in:
@@ -49,15 +49,24 @@ struct SettingsRow {
|
||||
/// This row, when tapped, will push the the Add Account screen
|
||||
/// in to view.
|
||||
static var addAccount: some View {
|
||||
NavigationLink(destination: AccountsManagementView()) {
|
||||
Label {
|
||||
Text("button.title.manage-accounts", comment: "Manage Accounts")
|
||||
} icon: {
|
||||
Image("app.account")
|
||||
.resizable()
|
||||
.frame(width: 25.0, height: 25.0)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 6))
|
||||
}
|
||||
// NavigationLink(destination: AccountsManagementView()) {
|
||||
// Label {
|
||||
// Text("button.title.manage-accounts", comment: "Manage Accounts")
|
||||
// } icon: {
|
||||
// Image("app.account")
|
||||
// .resizable()
|
||||
// .frame(width: 25.0, height: 25.0)
|
||||
// .clipShape(RoundedRectangle(cornerRadius: 6))
|
||||
// }
|
||||
// }
|
||||
|
||||
Label {
|
||||
Text("button.title.manage-accounts", comment: "Manage Accounts")
|
||||
} icon: {
|
||||
Image("app.account")
|
||||
.resizable()
|
||||
.frame(width: 25.0, height: 25.0)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 6))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,7 +207,9 @@ struct SettingsRow {
|
||||
/// This row, when tapped, will push the New Article Notifications
|
||||
/// screen in to view.
|
||||
static func configureAppearance(_ isShown: Binding<Bool>) -> some View {
|
||||
NavigationLink(destination: DisplayAndBehaviorsView(), isActive: isShown) {
|
||||
NavigationLink {
|
||||
DisplayAndBehaviorsView()
|
||||
} label: {
|
||||
Label {
|
||||
Text("button.title.display-and-behaviors", comment: "Display & Behaviors")
|
||||
} icon: {
|
||||
@@ -208,6 +219,7 @@ struct SettingsRow {
|
||||
.clipShape(RoundedRectangle(cornerRadius: 6))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// Sets the help sheet the user wishes to see.
|
||||
|
||||
@@ -21,7 +21,7 @@ struct SettingsView: View {
|
||||
@Binding var isConfigureAppearanceShown: Bool
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
NavigationStack {
|
||||
List {
|
||||
// Device Permissions
|
||||
Section(header: Text("label.text.device-permissions", comment: "Device Permissions"),
|
||||
@@ -101,9 +101,8 @@ struct SettingsView: View {
|
||||
AboutView()
|
||||
}
|
||||
.task {
|
||||
UNUserNotificationCenter.current().getNotificationSettings { settings in
|
||||
Task { await MainActor.run { self.viewModel.notificationPermissions = settings.authorizationStatus }}
|
||||
}
|
||||
let settings = await UNUserNotificationCenter.current().notificationSettings()
|
||||
Task { await MainActor.run { self.viewModel.notificationPermissions = settings.authorizationStatus }}
|
||||
}
|
||||
.onChange(of: scenePhase, perform: { phase in
|
||||
if phase == .active {
|
||||
@@ -155,6 +154,7 @@ struct SettingsView: View {
|
||||
isPresented: $viewModel.showImportExportError,
|
||||
actions: {},
|
||||
message: { Text(verbatim: viewModel.importExportError?.localizedDescription ?? "") } )
|
||||
}.navigationViewStyle(.stack)
|
||||
}
|
||||
.navigationViewStyle(.stack)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user