Skip to content
This repository was archived by the owner on Jul 4, 2020. It is now read-only.

Commit 9e403f1

Browse files
committed
Add string property
1 parent a4ea1d1 commit 9e403f1

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

ShortcutsSwift.playgroundbook/Contents/Sources/Aggrandizement.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,14 @@ public enum Aggrandizement {
107107
case fileSize
108108
case fileExtension
109109
case number(Number)
110+
case string(String)
110111

111112
var propertyListValue: Any {
112113
switch self {
113114
case .fileSize: return "WFFileSizeProperty"
114115
case .fileExtension: return "WFFileExtensionProperty"
115116
case .number(let number): return number
117+
case .string(let string): return string
116118
}
117119
}
118120
}

Tests/AggrandizementTests.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ class AggrandizementTests: XCTestCase {
4646
)
4747
}
4848

49+
func testCustomStringProperty() {
50+
let result = actionOutput()
51+
let title = result.with(propertyName: .custom("Title"), userInfo: .string("title"))
52+
_ = buildShortcut(
53+
getBatteryLevel().savingOutput(to: result)
54+
+ showResult("Test Aggrandizements \(title)")
55+
)
56+
}
57+
4958
func testCoercion() {
5059
let result = actionOutput()
5160
let coercion = result.with(type: .article)

0 commit comments

Comments
 (0)