|
72 | 72 | var allCases: [UNAuthorizationOptions] = [
|
73 | 73 | .alert
|
74 | 74 | ]
|
75 |
| - #if os(iOS) || os(watchOS) |
76 |
| - if #available(iOS 13, watchOS 6, *) { |
77 |
| - allCases.append(.announcement) |
78 |
| - } |
79 |
| - #endif |
80 |
| - if #available(iOS 12, tvOS 12, watchOS 5, *) { |
81 |
| - allCases.append(contentsOf: [ |
82 |
| - .badge, |
83 |
| - .carPlay, |
84 |
| - .criticalAlert, |
85 |
| - .providesAppNotificationSettings, |
86 |
| - .provisional, |
87 |
| - .sound, |
88 |
| - ]) |
89 |
| - } |
| 75 | + self.append_iOS_13_watchOS_6(&allCases) |
| 76 | + self.append_iOS_12_tvOS_12_watchOS_5(&allCases) |
90 | 77 | for option in allCases {
|
91 | 78 | if options.contains(option) {
|
92 | 79 | children.append(.init(rawValue: option))
|
|
103 | 90 | displayStyle: .set
|
104 | 91 | )
|
105 | 92 | }
|
| 93 | + |
| 94 | + // NB: Workaround for Xcode 13.2's new, experimental build system. (Fixed in Xcode 13.3.) |
| 95 | + // |
| 96 | + // defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1 |
| 97 | + private func append_iOS_13_watchOS_6(_ allCases: inout [UNAuthorizationOptions]) { |
| 98 | + #if os(iOS) || os(watchOS) |
| 99 | + if #available(iOS 13, watchOS 6, *) { |
| 100 | + allCases.append(.announcement) |
| 101 | + } |
| 102 | + #endif |
| 103 | + } |
| 104 | + |
| 105 | + // NB: Workaround for Xcode 13.2's new, experimental build system. (Fixed in Xcode 13.3.) |
| 106 | + // |
| 107 | + // defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1 |
| 108 | + private func append_iOS_12_tvOS_12_watchOS_5(_ allCases: inout [UNAuthorizationOptions]) { |
| 109 | + if #available(iOS 12, tvOS 12, watchOS 5, *) { |
| 110 | + allCases.append(contentsOf: [ |
| 111 | + .badge, |
| 112 | + .carPlay, |
| 113 | + .criticalAlert, |
| 114 | + .providesAppNotificationSettings, |
| 115 | + .provisional, |
| 116 | + .sound, |
| 117 | + ]) |
| 118 | + } |
| 119 | + } |
106 | 120 | }
|
107 | 121 |
|
108 | 122 | @available(iOS 10, macOS 10.14, tvOS 10, watchOS 3, *)
|
|
193 | 207 | )
|
194 | 208 | }
|
195 | 209 |
|
196 |
| - // NB: Workaround for Xcode 13.2's new, experimental build system. |
| 210 | + // NB: Workaround for Xcode 13.2's new, experimental build system. (Fixed in Xcode 13.3.) |
197 | 211 | //
|
198 | 212 | // defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1
|
199 | 213 | private func appendBannerList(_ allCases: inout [UNNotificationPresentationOptions]) {
|
|
0 commit comments