Skip to content

Commit

Permalink
Conform AppToMonitor to ExpressibleByArrayLiteral
Browse files Browse the repository at this point in the history
  • Loading branch information
emorydunn committed Dec 18, 2023
1 parent 8737c30 commit b5d7190
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Sources/StreamDeck/Support Models/PluginManifest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ public struct PluginSoftware: Codable, ExpressibleByStringLiteral {
/// In order to do so, the ApplicationsToMonitor object should contain for each platform an array specifying the list of application identifiers to monitor.
///
/// - Note: On macOS the application bundle identifier is used while the exe filename is used on Windows.
public struct ApplicationsToMonitor: Codable {
public struct ApplicationsToMonitor: Codable, ExpressibleByArrayLiteral {

/// Mac applications to monitor
public let mac: [String]
Expand All @@ -510,6 +510,14 @@ public struct ApplicationsToMonitor: Codable {
self.mac = mac
self.windows = windows
}

/// Initialize new applications to monitor.
///
/// - Note: Using the array literal will set the same applications to both macOS and Windows.
/// - Parameter elements: The applications to monitor.
public init(arrayLiteral elements: String...) {
self.init(mac: elements, windows: elements)
}
}

/// Preconfigured plugin profiles.
Expand Down

0 comments on commit b5d7190

Please sign in to comment.