diff --git a/Package.swift b/Package.swift index 67298fb..f913543 100644 --- a/Package.swift +++ b/Package.swift @@ -55,6 +55,7 @@ let package = Package( ], dependencies: [ .package(url: "https://github.com/getditto/DittoSwiftPackage", from: "4.8.0"), + .package(url: "https://github.com/getditto/DittoPresenceViewerCore.git", from: "2.0.0"), .package(url: "https://github.com/apple/swift-collections", from: "1.0.0") ], targets: [ @@ -62,15 +63,8 @@ let package = Package( .target( name: "DittoPresenceViewer", dependencies: [ - .product(name: "DittoSwift", package: "DittoSwiftPackage") - ], - resources: [ - .copy("Resources/index.html"), - .copy("Resources/main.css"), - .copy("Resources/main.js"), - ], - cxxSettings: [ - .define("ENABLE_BITCODE", to: "NO") + .product(name: "DittoSwift", package: "DittoSwiftPackage"), + .product(name: "DittoPresenceViewerCore", package: "DittoPresenceViewerCore"), ] ), .target( diff --git a/Sources/DittoPresenceViewer/Bundle+FrameworkBundle.swift b/Sources/DittoPresenceViewer/Bundle+FrameworkBundle.swift deleted file mode 100644 index b4943b6..0000000 --- a/Sources/DittoPresenceViewer/Bundle+FrameworkBundle.swift +++ /dev/null @@ -1,20 +0,0 @@ -// -// Copyright © 2020 DittoLive Incorporated. All rights reserved. -// - -import Foundation - -extension Bundle { - - // https://blog.sabintsev.com/simultaneously-supporting-bundle-resources-in-swift-package-manager-and-cocoapods-3fa35f4bce4e - static var presenceViewerResourceBundle: Bundle { -#if SWIFT_PACKAGE - // Auto-generated for swift package - // https://developer.apple.com/forums/thread/650158?answerId=614513022#614513022 - Bundle.module -#else - Bundle(for: DittoPresenceView.self) -#endif - } - -} diff --git a/Sources/DittoPresenceViewer/DittoPresenceViewController.swift b/Sources/DittoPresenceViewer/DittoPresenceViewController.swift index 48b45da..7b182ac 100644 --- a/Sources/DittoPresenceViewer/DittoPresenceViewController.swift +++ b/Sources/DittoPresenceViewer/DittoPresenceViewController.swift @@ -34,14 +34,6 @@ import AppKit */ final class DittoPresenceViewController: PlatformViewController { - // MARK: Constants - - private struct LocalizedStrings { - static let title = NSLocalizedString("Ditto Presence", - bundle: Bundle.presenceViewerResourceBundle, - comment: "View controller title for the presence UI") - } - // MARK: - Properties #if canImport(UIKit) @@ -83,7 +75,7 @@ final class DittoPresenceViewController: PlatformViewController { override func viewDidLoad() { super.viewDidLoad() - title = LocalizedStrings.title + title = "Ditto Presence" #if canImport(UIKit) #if os(tvOS) @@ -128,7 +120,7 @@ final class DittoPresenceViewController: PlatformViewController { #if canImport(UIKit) guard navigationController == nil else { return } - navigationItem.title = LocalizedStrings.title + navigationItem.title = "Ditto Presence" #if !os(tvOS) navigationItem.largeTitleDisplayMode = .never #endif diff --git a/Sources/DittoPresenceViewer/JSWebView.swift b/Sources/DittoPresenceViewer/JSWebView.swift index 8e1e6a2..b75d952 100644 --- a/Sources/DittoPresenceViewer/JSWebView.swift +++ b/Sources/DittoPresenceViewer/JSWebView.swift @@ -2,7 +2,7 @@ // Copyright © 2020 DittoLive Incorporated. All rights reserved. // -import Foundation +@preconcurrency import Foundation #if canImport(WebKit) import WebKit #endif diff --git a/Sources/DittoPresenceViewer/PresenceView.swift b/Sources/DittoPresenceViewer/PresenceView.swift index 148bd5b..48ba0b9 100644 --- a/Sources/DittoPresenceViewer/PresenceView.swift +++ b/Sources/DittoPresenceViewer/PresenceView.swift @@ -20,7 +20,6 @@ import AppKit #endif #if canImport(WebKit) -@available(macOS 10.15, *) public struct PresenceView: View { private var ditto: Ditto diff --git a/Sources/DittoPresenceViewer/Resources/index.html b/Sources/DittoPresenceViewer/Resources/index.html deleted file mode 100644 index 3475960..0000000 --- a/Sources/DittoPresenceViewer/Resources/index.html +++ /dev/null @@ -1 +0,0 @@ -
"://,"
":/<\/b>/,"")||t.parseEndTag("bold","")||t.parseEndTag("ital","
")||t.parseEndTag("mono",""))||i(o)||t.add(o),t.position++}return t.emitBlock(),t.blocks}},{key:"splitMarkdownBlocks",value:function(e){for(var t=this,i=new l(e),o=!0,n=function(e){return!!/\\/.test(e)&&(i.position