Skip to content

Commit

Permalink
UNNotificationPresentationOptions [.banner, .list] workaround (#30)
Browse files Browse the repository at this point in the history
* UNNotificationPresentationOptions [.banner, .list] workaround

* Update Sources/CustomDump/Conformances/UserNotifications.swift

Co-authored-by: Stephen Celis <[email protected]>
  • Loading branch information
jaanussiim and stephencelis authored Dec 8, 2021
1 parent 25292d6 commit 51698ec
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Sources/CustomDump/Conformances/UserNotifications.swift
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,7 @@
.alert,
.badge,
]
if #available(iOS 14, macOS 11, tvOS 14, watchOS 7, *) {
allCases.append(contentsOf: [.banner, .list])
}
appendBannerList(&allCases)
allCases.append(.sound)
for option in allCases {
if options.contains(option) {
Expand All @@ -174,6 +172,15 @@
displayStyle: .set
)
}

// NB: Workaround for Xcode 13.2's new, experimental build system.
//
// defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1
private func appendBannerList(_ allCases: inout [UNNotificationPresentationOptions]) {
if #available(iOS 14, macOS 11, tvOS 14, watchOS 7, *) {
allCases.append(contentsOf: [.banner, .list])
}
}
}

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

0 comments on commit 51698ec

Please sign in to comment.