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:
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="AJQ-jq-uMa">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="AJQ-jq-uMa">
|
||||
<device id="retina6_1" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
|
||||
<capability name="Named colors" minToolsVersion="9.0"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||
@@ -18,7 +18,7 @@
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<view hidden="YES" contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="h1Q-FS-jlg" customClass="ArticleSearchBar" customModule="NetNewsWire" customModuleProvider="target">
|
||||
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="h1Q-FS-jlg" customClass="ArticleSearchBar" customModule="NetNewsWire" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="777" width="414" height="36"/>
|
||||
<color key="backgroundColor" name="barBackgroundColor"/>
|
||||
</view>
|
||||
|
||||
@@ -127,11 +127,7 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner, Ma
|
||||
}
|
||||
|
||||
var node: Node? = nil
|
||||
if let coordinator = unreadCountProvider as? SceneCoordinator, let feed = coordinator.timelineFeed {
|
||||
node = coordinator.rootNode.descendantNodeRepresentingObject(feed as AnyObject)
|
||||
} else {
|
||||
node = coordinator.rootNode.descendantNodeRepresentingObject(unreadCountProvider as AnyObject)
|
||||
}
|
||||
node = coordinator.rootNode.descendantNodeRepresentingObject(unreadCountProvider as AnyObject)
|
||||
|
||||
guard let unreadCountNode = node, let indexPath = coordinator.indexPathFor(unreadCountNode) else { return }
|
||||
if let cell = tableView.cellForRow(at: indexPath) as? MasterFeedTableViewCell {
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
//
|
||||
// InteractiveLabel.swift
|
||||
// NetNewsWire-iOS
|
||||
//
|
||||
// Created by Maurice Parker on 11/3/19.
|
||||
// Copyright © 2019 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
@IBDesignable
|
||||
class InteractiveLabel: UILabel {
|
||||
|
||||
override init(frame: CGRect) {
|
||||
super.init(frame: frame)
|
||||
commonInit()
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
super.init(coder: coder)
|
||||
commonInit()
|
||||
}
|
||||
|
||||
func commonInit() {
|
||||
let gestureRecognizer = UILongPressGestureRecognizer(target: self, action: #selector(handleLongPressGesture(_:)))
|
||||
self.addGestureRecognizer(gestureRecognizer)
|
||||
self.isUserInteractionEnabled = true
|
||||
}
|
||||
|
||||
@objc func handleLongPressGesture(_ recognizer: UIGestureRecognizer) {
|
||||
guard recognizer.state == .began,
|
||||
let recognizerView = recognizer.view,
|
||||
let recognizerSuperView = recognizerView.superview,
|
||||
recognizerView.becomeFirstResponder() else {
|
||||
return
|
||||
}
|
||||
|
||||
UIMenuController.shared.showMenu(from: recognizerSuperView, rect: recognizerView.frame)
|
||||
}
|
||||
|
||||
override var canBecomeFirstResponder: Bool {
|
||||
return true
|
||||
}
|
||||
|
||||
override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool {
|
||||
return (action == #selector(UIResponderStandardEditActions.copy(_:)))
|
||||
|
||||
}
|
||||
|
||||
override func copy(_ sender: Any?) {
|
||||
UIPasteboard.general.string = text
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user