Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use external DittoPresenceViewerCore dependency #166

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

This file was deleted.

12 changes: 3 additions & 9 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,16 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/getditto/DittoSwiftPackage", from: "4.8.0"),
.package(url: "https://github.com/getditto/DittoPresenceViewerCore.git", branch: "BP/box"),
.package(url: "https://github.com/apple/swift-collections", from: "1.0.0")
],
targets: [
.target(name: "DittoHealthMetrics"),
.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(
Expand Down
20 changes: 0 additions & 20 deletions Sources/DittoPresenceViewer/Bundle+FrameworkBundle.swift

This file was deleted.

12 changes: 2 additions & 10 deletions Sources/DittoPresenceViewer/DittoPresenceViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ import AppKit
*/
final class DittoPresenceViewController: PlatformViewController {

// MARK: Constants

private struct LocalizedStrings {
static let title = NSLocalizedString("Ditto Presence",
bplattenburg marked this conversation as resolved.
Show resolved Hide resolved
bundle: Bundle.presenceViewerResourceBundle,
comment: "View controller title for the presence UI")
}

// MARK: - Properties

#if canImport(UIKit)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Sources/DittoPresenceViewer/JSWebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Copyright © 2020 DittoLive Incorporated. All rights reserved.
//

import Foundation
@preconcurrency import Foundation
bplattenburg marked this conversation as resolved.
Show resolved Hide resolved
#if canImport(WebKit)
import WebKit
#endif
Expand Down
1 change: 0 additions & 1 deletion Sources/DittoPresenceViewer/PresenceView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import AppKit
#endif

#if canImport(WebKit)
@available(macOS 10.15, *)
bplattenburg marked this conversation as resolved.
Show resolved Hide resolved
public struct PresenceView: View {
private var ditto: Ditto

Expand Down
1 change: 0 additions & 1 deletion Sources/DittoPresenceViewer/Resources/index.html

This file was deleted.

102 changes: 0 additions & 102 deletions Sources/DittoPresenceViewer/Resources/main.css

This file was deleted.

2 changes: 0 additions & 2 deletions Sources/DittoPresenceViewer/Resources/main.js

This file was deleted.

30 changes: 0 additions & 30 deletions Sources/DittoPresenceViewer/Resources/main.js.LICENSE.txt

This file was deleted.

9 changes: 3 additions & 6 deletions Sources/DittoPresenceViewer/VisJSWebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Copyright © 2020 DittoLive Incorporated. All rights reserved.
//

import Foundation
import DittoPresenceViewerCore

#if canImport(WebKit)
import WebKit
Expand All @@ -28,12 +28,9 @@ class VisJSWebView: JSWebView {
}

private func setup() {
let bundle = Bundle.module
let webDistDirURL = bundle.bundleURL.appendingPathComponent("dist")
let htmlURL = bundle.url(forResource: "index", withExtension: "html")!
let htmlString = try! String(contentsOf: htmlURL, encoding: .utf8)
let htmlString = try! String(contentsOf: DittoPresenceViewerResources.htmlURL, encoding: .utf8)
#if canImport(WebKit)
webView.loadHTMLString(htmlString, baseURL: webDistDirURL)
webView.loadHTMLString(htmlString, baseURL: DittoPresenceViewerResources.webDistDirURL)
#endif
}

Expand Down