From 836d31875dc77e85e71b4e44aa81e92231d90c2e Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sat, 7 Dec 2024 14:52:38 -0800 Subject: [PATCH] Fix several warnings. --- iOS/AppDelegate.swift | 2 +- iOS/Article/PreloadedWebView.swift | 2 +- iOS/MasterFeed/MasterFeedViewController+Drag.swift | 3 ++- iOS/SceneCoordinator.swift | 6 +++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/iOS/AppDelegate.swift b/iOS/AppDelegate.swift index 3bc35b786..37f48cb30 100644 --- a/iOS/AppDelegate.swift +++ b/iOS/AppDelegate.swift @@ -196,7 +196,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD } func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { - completionHandler([.alert, .badge, .sound]) + completionHandler([.list, .banner, .badge, .sound]) } func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { diff --git a/iOS/Article/PreloadedWebView.swift b/iOS/Article/PreloadedWebView.swift index ea8722e02..fd407ca0b 100644 --- a/iOS/Article/PreloadedWebView.swift +++ b/iOS/Article/PreloadedWebView.swift @@ -17,10 +17,10 @@ class PreloadedWebView: WKWebView { init(articleIconSchemeHandler: ArticleIconSchemeHandler) { let preferences = WKPreferences() preferences.javaScriptCanOpenWindowsAutomatically = false - preferences.javaScriptEnabled = true let configuration = WKWebViewConfiguration() configuration.preferences = preferences + configuration.defaultWebpagePreferences.allowsContentJavaScript = true configuration.setValue(true, forKey: "allowUniversalAccessFromFileURLs") configuration.allowsInlineMediaPlayback = true configuration.mediaTypesRequiringUserActionForPlayback = .audio diff --git a/iOS/MasterFeed/MasterFeedViewController+Drag.swift b/iOS/MasterFeed/MasterFeedViewController+Drag.swift index 9bf7a5010..9553afedf 100644 --- a/iOS/MasterFeed/MasterFeedViewController+Drag.swift +++ b/iOS/MasterFeed/MasterFeedViewController+Drag.swift @@ -9,6 +9,7 @@ import UIKit import MobileCoreServices import Account +import UniformTypeIdentifiers extension MasterFeedViewController: UITableViewDragDelegate { @@ -20,7 +21,7 @@ extension MasterFeedViewController: UITableViewDragDelegate { let data = webFeed.url.data(using: .utf8) let itemProvider = NSItemProvider() - itemProvider.registerDataRepresentation(forTypeIdentifier: kUTTypeURL as String, visibility: .ownProcess) { completion in + itemProvider.registerDataRepresentation(forTypeIdentifier: UTType.url.identifier, visibility: .ownProcess) { completion in completion(data, nil) return nil } diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift index 1427cb7a5..ebf159d48 100644 --- a/iOS/SceneCoordinator.swift +++ b/iOS/SceneCoordinator.swift @@ -332,7 +332,7 @@ class SceneCoordinator: NSObject, UndoableCommandRunner { func start(for size: CGSize) -> UIViewController { rootSplitViewController = RootSplitViewController() rootSplitViewController.coordinator = self - rootSplitViewController.preferredDisplayMode = .allVisible + rootSplitViewController.preferredDisplayMode = .oneBesideSecondary rootSplitViewController.viewControllers = [InteractiveNavigationController.template()] rootSplitViewController.delegate = self @@ -1303,7 +1303,7 @@ class SceneCoordinator: NSObject, UndoableCommandRunner { } func toggleSidebar() { - rootSplitViewController.preferredDisplayMode = rootSplitViewController.displayMode == .allVisible ? .primaryHidden : .allVisible + rootSplitViewController.preferredDisplayMode = rootSplitViewController.displayMode == .oneBesideSecondary ? .secondaryOnly : .oneBesideSecondary } func selectArticleInCurrentFeed(_ articleID: String, isShowingExtractedArticle: Bool? = nil, articleWindowScrollY: Int? = nil) { @@ -2160,7 +2160,7 @@ private extension SceneCoordinator { rootSplitViewController.preferredPrimaryColumnWidthFraction = 0.30 subSplitViewController = UISplitViewController() - subSplitViewController!.preferredDisplayMode = .allVisible + subSplitViewController!.preferredDisplayMode = .oneBesideSecondary subSplitViewController!.viewControllers = [InteractiveNavigationController.template()] subSplitViewController!.preferredPrimaryColumnWidthFraction = 0.4285