diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReader.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReader.swift index 7a5aefa56..2d817fcb6 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReader.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReader.swift @@ -116,13 +116,15 @@ struct WebReader: PlatformViewRepresentable { (webView as? OmnivoreWebView)?.updateTitle(title: item.title ?? "") (webView as? OmnivoreWebView)?.updateJustifyText() - webView.backgroundColor = UIColor(ThemeManager.currentBgColor) - webView.tintColor = UIColor(ThemeManager.currentHighlightColor) - webView.underPageBackgroundColor = UIColor(ThemeManager.currentBgColor) - webView.scrollView.backgroundColor = UIColor(ThemeManager.currentBgColor) - webView.scrollView.indicatorStyle = ThemeManager.currentTheme.isDark ? - UIScrollView.IndicatorStyle.white : - UIScrollView.IndicatorStyle.black + #if os(iOS) + webView.backgroundColor = UIColor(ThemeManager.currentBgColor) + webView.tintColor = UIColor(ThemeManager.currentHighlightColor) + webView.underPageBackgroundColor = UIColor(ThemeManager.currentBgColor) + webView.scrollView.backgroundColor = UIColor(ThemeManager.currentBgColor) + webView.scrollView.indicatorStyle = ThemeManager.currentTheme.isDark ? + UIScrollView.IndicatorStyle.white : + UIScrollView.IndicatorStyle.black + #endif } if showNavBarActionID != context.coordinator.previousShowNavBarActionID { diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift index cfff418af..4c4289dab 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift @@ -288,30 +288,30 @@ struct WebReaderContainerView: View { #if os(iOS) audioNavbarItem - #endif - Button( - action: { - if UIDevice.current.userInterfaceIdiom == .phone { - showPreferencesFormsheet.toggle() - } else { - showPreferencesPopover.toggle() + Button( + action: { + if UIDevice.current.userInterfaceIdiom == .phone { + showPreferencesFormsheet.toggle() + } else { + showPreferencesPopover.toggle() + } + }, + label: { + Image(systemName: "textformat.size") + .font(.appNavbarIcon) } - }, - label: { - Image(systemName: "textformat.size") - .font(.appNavbarIcon) + ) + .padding(.horizontal, 5) + .scaleEffect(navBarVisibilityRatio) + .popover(isPresented: $showPreferencesPopover) { + webPreferencesPopoverView + .frame(maxWidth: 400, maxHeight: 475) } - ) - .padding(.horizontal, 5) - .scaleEffect(navBarVisibilityRatio) - .popover(isPresented: $showPreferencesPopover) { - webPreferencesPopoverView - .frame(maxWidth: 400, maxHeight: 475) - } - .formSheet(isPresented: $showPreferencesFormsheet, modalSize: CGSize(width: 400, height: 475)) { - webPreferencesPopoverView - } + .formSheet(isPresented: $showPreferencesFormsheet, modalSize: CGSize(width: 400, height: 475)) { + webPreferencesPopoverView + } + #endif #if os(macOS) Spacer() @@ -596,7 +596,9 @@ struct WebReaderContainerView: View { #if os(iOS) UIPasteboard.general.string = deepLink.absoluteString #else - Pasteboard.general.string = deepLink.absoluteString + let pasteBoard = NSPasteboard.general + pasteBoard.clearContents() + pasteBoard.writeObjects([deepLink.absoluteString as NSString]) #endif showInSnackbar("Deeplink Copied") } else { diff --git a/apple/OmnivoreKit/Sources/Views/Article/HighlightAnnotationSheet.swift b/apple/OmnivoreKit/Sources/Views/Article/HighlightAnnotationSheet.swift index 2c59dfa16..3221fe154 100644 --- a/apple/OmnivoreKit/Sources/Views/Article/HighlightAnnotationSheet.swift +++ b/apple/OmnivoreKit/Sources/Views/Article/HighlightAnnotationSheet.swift @@ -50,19 +50,22 @@ public struct HighlightAnnotationSheet: View { } .padding() .navigationTitle("Note") - .navigationBarTitleDisplayMode(.inline) - .navigationBarItems(leading: Button(action: onCancel, label: { - Text("Cancel") - })) - .navigationBarItems(trailing: Button(action: onSave, label: { - Text("Save").bold() - })) + #if os(iOS) + .navigationBarTitleDisplayMode(.inline) + + .navigationBarItems(leading: Button(action: onCancel, label: { + Text("Cancel") + })) + .navigationBarItems(trailing: Button(action: onSave, label: { + Text("Save").bold() + })) + #endif .listStyle(PlainListStyle()) - .alert(errorAlertMessage ?? LocalText.readerError, isPresented: $showErrorAlertMessage) { - Button(LocalText.genericOk, role: .cancel, action: { - errorAlertMessage = nil - showErrorAlertMessage = false - }) - } + .alert(errorAlertMessage ?? LocalText.readerError, isPresented: $showErrorAlertMessage) { + Button(LocalText.genericOk, role: .cancel, action: { + errorAlertMessage = nil + showErrorAlertMessage = false + }) + } } } diff --git a/apple/OmnivoreKit/Sources/Views/Article/OmnivoreWebView.swift b/apple/OmnivoreKit/Sources/Views/Article/OmnivoreWebView.swift index 1816a4a0f..b3e07b9a6 100644 --- a/apple/OmnivoreKit/Sources/Views/Article/OmnivoreWebView.swift +++ b/apple/OmnivoreKit/Sources/Views/Article/OmnivoreWebView.swift @@ -187,7 +187,7 @@ public final class OmnivoreWebView: WKWebView { override public func viewDidChangeEffectiveAppearance() { super.viewDidChangeEffectiveAppearance() if ThemeManager.currentTheme == .system { - try dispatchEvent(.updateTheme(themeName: ThemeManager.currentTheme.themeKey)) + try? dispatchEvent(.updateTheme(themeName: ThemeManager.currentTheme.themeKey)) } } #endif diff --git a/apple/OmnivoreKit/Sources/Views/FeedItem/LibraryItemCard.swift b/apple/OmnivoreKit/Sources/Views/FeedItem/LibraryItemCard.swift index 965404147..1e460d7b2 100644 --- a/apple/OmnivoreKit/Sources/Views/FeedItem/LibraryItemCard.swift +++ b/apple/OmnivoreKit/Sources/Views/FeedItem/LibraryItemCard.swift @@ -4,11 +4,13 @@ import Utils public extension View { func draggableItem(item: LinkedItem) -> some View { - if #available(iOS 16.0, *), let url = item.deepLink { - return AnyView(self.draggable(url) { - Label(item.unwrappedTitle, systemImage: "link") - }) - } + #if os(iOS) + if #available(iOS 16.0, *), let url = item.deepLink { + return AnyView(self.draggable(url) { + Label(item.unwrappedTitle, systemImage: "link") + }) + } + #endif return AnyView(self) } }