Skip to content

Commit 51698ec

Browse files
UNNotificationPresentationOptions [.banner, .list] workaround (#30)
* UNNotificationPresentationOptions [.banner, .list] workaround * Update Sources/CustomDump/Conformances/UserNotifications.swift Co-authored-by: Stephen Celis <[email protected]>
1 parent 25292d6 commit 51698ec

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Sources/CustomDump/Conformances/UserNotifications.swift

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,7 @@
154154
.alert,
155155
.badge,
156156
]
157-
if #available(iOS 14, macOS 11, tvOS 14, watchOS 7, *) {
158-
allCases.append(contentsOf: [.banner, .list])
159-
}
157+
appendBannerList(&allCases)
160158
allCases.append(.sound)
161159
for option in allCases {
162160
if options.contains(option) {
@@ -174,6 +172,15 @@
174172
displayStyle: .set
175173
)
176174
}
175+
176+
// NB: Workaround for Xcode 13.2's new, experimental build system.
177+
//
178+
// defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1
179+
private func appendBannerList(_ allCases: inout [UNNotificationPresentationOptions]) {
180+
if #available(iOS 14, macOS 11, tvOS 14, watchOS 7, *) {
181+
allCases.append(contentsOf: [.banner, .list])
182+
}
183+
}
177184
}
178185

179186
@available(iOS 10, macOS 10.14, tvOS 10, watchOS 3, *)

0 commit comments

Comments
 (0)