|
12 | 12 | message:
|
13 | 13 | "Use the 'fullScreenCover(item:)' (or 'fullScreenCover(item:id:)') overload that passes a binding"
|
14 | 14 | )
|
15 |
| - public func fullScreenCover<Value, Content>( |
| 15 | + public func fullScreenCover<Value, Content: View>( |
16 | 16 | unwrapping value: Binding<Value?>,
|
17 | 17 | onDismiss: (() -> Void)? = nil,
|
18 | 18 | @ViewBuilder content: @escaping (Binding<Value>) -> Content
|
19 |
| - ) -> some View |
20 |
| - where Content: View { |
| 19 | + ) -> some View { |
21 | 20 | self.fullScreenCover(
|
22 | 21 | isPresented: Binding(value),
|
23 | 22 | onDismiss: onDismiss
|
|
106 | 105 | *, deprecated,
|
107 | 106 | message: "Use the 'sheet(item:)' (or 'sheet(item:id:)') overload that passes a binding"
|
108 | 107 | )
|
109 |
| - public func sheet<Value, Content>( |
| 108 | + public func sheet<Value, Content: View>( |
110 | 109 | unwrapping value: Binding<Value?>,
|
111 | 110 | onDismiss: (() -> Void)? = nil,
|
112 | 111 | @ViewBuilder content: @escaping (Binding<Value>) -> Content
|
113 |
| - ) -> some View |
114 |
| - where Content: View { |
| 112 | + ) -> some View { |
115 | 113 | self.sheet(isPresented: Binding(value), onDismiss: onDismiss) {
|
116 | 114 | Binding(unwrapping: value).map(content)
|
117 | 115 | }
|
|
363 | 361 | message:
|
364 | 362 | "Chain a '@CasePathable' enum binding into a case directly instead of specifying a case path."
|
365 | 363 | )
|
366 |
| - public func fullScreenCover<Enum, Case, Content>( |
| 364 | + public func fullScreenCover<Enum, Case, Content: View>( |
367 | 365 | unwrapping enum: Binding<Enum?>,
|
368 | 366 | case casePath: AnyCasePath<Enum, Case>,
|
369 | 367 | onDismiss: (() -> Void)? = nil,
|
370 | 368 | @ViewBuilder content: @escaping (Binding<Case>) -> Content
|
371 |
| - ) -> some View |
372 |
| - where Content: View { |
| 369 | + ) -> some View { |
373 | 370 | fullScreenCover(
|
374 | 371 | unwrapping: `enum`.case(casePath), onDismiss: onDismiss, content: content)
|
375 | 372 | }
|
|
399 | 396 | message:
|
400 | 397 | "Chain a '@CasePathable' enum binding into a case directly instead of specifying a case path."
|
401 | 398 | )
|
402 |
| - public func popover<Enum, Case, Content>( |
| 399 | + public func popover<Enum, Case, Content: View>( |
403 | 400 | unwrapping enum: Binding<Enum?>,
|
404 | 401 | case casePath: AnyCasePath<Enum, Case>,
|
405 | 402 | attachmentAnchor: PopoverAttachmentAnchor = .rect(.bounds),
|
406 | 403 | arrowEdge: Edge = .top,
|
407 | 404 | @ViewBuilder content: @escaping (Binding<Case>) -> Content
|
408 |
| - ) -> some View where Content: View { |
| 405 | + ) -> some View { |
409 | 406 | popover(
|
410 | 407 | unwrapping: `enum`.case(casePath),
|
411 | 408 | attachmentAnchor: attachmentAnchor,
|
|
420 | 417 | "Chain a '@CasePathable' enum binding into a case directly instead of specifying a case path."
|
421 | 418 | )
|
422 | 419 | @MainActor
|
423 |
| - public func sheet<Enum, Case, Content>( |
| 420 | + public func sheet<Enum, Case, Content: View>( |
424 | 421 | unwrapping enum: Binding<Enum?>,
|
425 | 422 | case casePath: AnyCasePath<Enum, Case>,
|
426 | 423 | onDismiss: (() -> Void)? = nil,
|
427 | 424 | @ViewBuilder content: @escaping (Binding<Case>) -> Content
|
428 |
| - ) -> some View |
429 |
| - where Content: View { |
| 425 | + ) -> some View { |
430 | 426 | sheet(unwrapping: `enum`.case(casePath), onDismiss: onDismiss, content: content)
|
431 | 427 | }
|
432 | 428 | }
|
|
528 | 524 | }
|
529 | 525 | }
|
530 | 526 |
|
531 |
| - public struct IfCaseLet<Enum, Case: Sendable, IfContent, ElseContent>: View |
532 |
| - where IfContent: View, ElseContent: View { |
| 527 | + public struct IfCaseLet<Enum, Case: Sendable, IfContent: View, ElseContent: View>: View { |
533 | 528 | public let `enum`: Binding<Enum>
|
534 | 529 | public let casePath: AnyCasePath<Enum, Case>
|
535 | 530 | public let ifContent: (Binding<Case>) -> IfContent
|
|
605 | 600 | }
|
606 | 601 | }
|
607 | 602 |
|
608 |
| - public struct IfLet<Value, IfContent, ElseContent>: View |
609 |
| - where IfContent: View, ElseContent: View { |
| 603 | + public struct IfLet<Value, IfContent: View, ElseContent: View>: View { |
610 | 604 | public let value: Binding<Value?>
|
611 | 605 | public let ifContent: (Binding<Value>) -> IfContent
|
612 | 606 | public let elseContent: ElseContent
|
|
770 | 764 | message:
|
771 | 765 | "Switch over a '@CasePathable' enum and derive bindings from each case using '$enum.case.map { $case in … }', instead."
|
772 | 766 | )
|
773 |
| - public struct CaseLet<Enum, Case: Sendable, Content>: Sendable, View |
774 |
| - where Content: View { |
| 767 | + public struct CaseLet<Enum, Case: Sendable, Content: View>: Sendable, View { |
775 | 768 | @EnvironmentObject private var `enum`: BindingObject<Enum>
|
776 | 769 | public let casePath: AnyCasePath<Enum, Case>
|
777 | 770 | public let content: (Binding<Case>) -> Content
|
|
1855 | 1848 | action handler: @escaping @Sendable (Value) async -> Void = { (_: Void) async in }
|
1856 | 1849 | ) -> some View {
|
1857 | 1850 | alert(value) { (value: Value?) in
|
1858 |
| - if let value = value { |
| 1851 | + if let value { |
1859 | 1852 | await handler(value)
|
1860 | 1853 | }
|
1861 | 1854 | }
|
|
1874 | 1867 | action handler: @escaping @Sendable (Value) async -> Void = { (_: Void) async in }
|
1875 | 1868 | ) -> some View {
|
1876 | 1869 | alert(unwrapping: `enum`, case: casePath) { (value: Value?) async in
|
1877 |
| - if let value = value { |
| 1870 | + if let value { |
1878 | 1871 | await handler(value)
|
1879 | 1872 | }
|
1880 | 1873 | }
|
|
1892 | 1885 | action handler: @escaping @Sendable (Value) async -> Void = { (_: Void) async in }
|
1893 | 1886 | ) -> some View {
|
1894 | 1887 | confirmationDialog(unwrapping: value) { (value: Value?) in
|
1895 |
| - if let value = value { |
| 1888 | + if let value { |
1896 | 1889 | await handler(value)
|
1897 | 1890 | }
|
1898 | 1891 | }
|
|
1911 | 1904 | action handler: @escaping @Sendable (Value) async -> Void = { (_: Void) async in }
|
1912 | 1905 | ) -> some View {
|
1913 | 1906 | confirmationDialog(unwrapping: `enum`, case: casePath) { (value: Value?) async in
|
1914 |
| - if let value = value { |
| 1907 | + if let value { |
1915 | 1908 | await handler(value)
|
1916 | 1909 | }
|
1917 | 1910 | }
|
|
0 commit comments