mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-26 17:43:22 +01:00
29 lines
544 B
Swift
29 lines
544 B
Swift
//
|
|
// Browser.swift
|
|
// Evergren
|
|
//
|
|
// Created by Brent Simmons on 2/23/16.
|
|
// Copyright © 2016 Ranchero Software, LLC. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
import CoreServices
|
|
import RSWeb
|
|
|
|
struct Browser {
|
|
|
|
static func open(_ urlString: String) {
|
|
|
|
// Opens according to prefs.
|
|
open(urlString, inBackground: AppDefaults.shared.openInBrowserInBackground)
|
|
}
|
|
|
|
static func open(_ urlString: String, inBackground: Bool) {
|
|
|
|
if let url = URL(string: urlString) {
|
|
MacWebBrowser.openURL(url, inBackground: inBackground)
|
|
}
|
|
}
|
|
}
|
|
|