| 123456789101112131415161718192021222324252627282930313233343536 |
- //
- // AppLegalURLs.swift
- // App for Indeed
- //
- import AppKit
- import Foundation
- /// Legal, support, and marketing pages hosted on Google Sites.
- enum AppLegalURLs {
- private static let siteRoot = "https://sites.google.com/view/app-for-indeed"
- static let marketingHome = URL(string: "\(siteRoot)/home")!
- static let privacyPolicy = URL(string: "\(siteRoot)/privacy")!
- static let termsOfUse = URL(string: "\(siteRoot)/terms")!
- static let support = URL(string: "\(siteRoot)/support")!
- /// Opens the URL in Safari when available; otherwise uses the system default browser.
- static func openInSafari(_ url: URL) {
- let safariApp = URL(fileURLWithPath: "/Applications/Safari.app")
- guard FileManager.default.fileExists(atPath: safariApp.path) else {
- NSWorkspace.shared.open(url)
- return
- }
- NSWorkspace.shared.open(
- [url],
- withApplicationAt: safariApp,
- configuration: NSWorkspace.OpenConfiguration()
- ) { _, error in
- if error != nil {
- NSWorkspace.shared.open(url)
- }
- }
- }
- }
|