@@ -9,7 +9,7 @@ import UIKit
99@available ( iOS 13 . 0 , tvOS 13 . 0 , macOS 10 . 15 . 0 , * )
1010extension View {
1111 public func inject< SomeView> ( _ view: SomeView ) -> some View where SomeView: View {
12- return overlay ( view. frame ( width: 0 , height: 0 ) )
12+ overlay ( view. frame ( width: 0 , height: 0 ) )
1313 }
1414}
1515
@@ -22,15 +22,15 @@ extension View {
2222 selector: @escaping ( IntrospectionUIView ) -> TargetView ? ,
2323 customize: @escaping ( TargetView ) -> ( )
2424 ) -> some View {
25- return inject ( UIKitIntrospectionView (
25+ inject ( UIKitIntrospectionView (
2626 selector: selector,
2727 customize: customize
2828 ) )
2929 }
3030
3131 /// Finds a `UINavigationController` from any view embedded in a `SwiftUI.NavigationView`.
3232 public func introspectNavigationController( customize: @escaping ( UINavigationController ) -> ( ) ) -> some View {
33- return inject ( UIKitIntrospectionViewController (
33+ inject ( UIKitIntrospectionViewController (
3434 selector: { introspectionViewController in
3535
3636 // Search in ancestors
@@ -47,7 +47,7 @@ extension View {
4747
4848 /// Finds a `UISplitViewController` from a `SwiftUI.NavigationView` with style `DoubleColumnNavigationViewStyle`.
4949 public func introspectSplitViewController( customize: @escaping ( UISplitViewController ) -> ( ) ) -> some View {
50- return inject ( UIKitIntrospectionViewController (
50+ inject ( UIKitIntrospectionViewController (
5151 selector: { introspectionViewController in
5252
5353 // Search in ancestors
@@ -64,15 +64,15 @@ extension View {
6464
6565 /// Finds the containing `UIViewController` of a SwiftUI view.
6666 public func introspectViewController( customize: @escaping ( UIViewController ) -> ( ) ) -> some View {
67- return inject ( UIKitIntrospectionViewController (
67+ inject ( UIKitIntrospectionViewController (
6868 selector: { $0. parent } ,
6969 customize: customize
7070 ) )
7171 }
7272
7373 /// Finds a `UITabBarController` from any SwiftUI view embedded in a `SwiftUI.TabView`
7474 public func introspectTabBarController( customize: @escaping ( UITabBarController ) -> ( ) ) -> some View {
75- return inject ( UIKitIntrospectionViewController (
75+ inject ( UIKitIntrospectionViewController (
7676 selector: { introspectionViewController in
7777
7878 // Search in ancestors
@@ -89,12 +89,12 @@ extension View {
8989
9090 /// Finds a `UITableView` from a `SwiftUI.List`, or `SwiftUI.List` child.
9191 public func introspectTableView( customize: @escaping ( UITableView ) -> ( ) ) -> some View {
92- return introspect ( selector: TargetViewSelector . ancestorOrSiblingContaining, customize: customize)
92+ introspect ( selector: TargetViewSelector . ancestorOrSiblingContaining, customize: customize)
9393 }
9494
9595 /// Finds a `UITableViewCell` from a `SwiftUI.List`, or `SwiftUI.List` child. You can attach this directly to the element inside the list.
9696 public func introspectTableViewCell( customize: @escaping ( UITableViewCell ) -> ( ) ) -> some View {
97- return introspect ( selector: TargetViewSelector . ancestorOrSiblingContaining, customize: customize)
97+ introspect ( selector: TargetViewSelector . ancestorOrSiblingContaining, customize: customize)
9898 }
9999
100100 /// Finds a `UIScrollView` from a `SwiftUI.ScrollView`, or `SwiftUI.ScrollView` child.
@@ -108,48 +108,48 @@ extension View {
108108
109109 /// Finds a `UITextField` from a `SwiftUI.TextField`
110110 public func introspectTextField( customize: @escaping ( UITextField ) -> ( ) ) -> some View {
111- return introspect ( selector: TargetViewSelector . siblingContainingOrAncestorOrAncestorChild, customize: customize)
111+ introspect ( selector: TargetViewSelector . siblingContainingOrAncestorOrAncestorChild, customize: customize)
112112 }
113113
114114 /// Finds a `UITextView` from a `SwiftUI.TextEditor`
115115 public func introspectTextView( customize: @escaping ( UITextView ) -> ( ) ) -> some View {
116- return introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
116+ introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
117117 }
118118
119119 /// Finds a `UISwitch` from a `SwiftUI.Toggle`
120120 @available ( tvOS, unavailable)
121121 public func introspectSwitch( customize: @escaping ( UISwitch ) -> ( ) ) -> some View {
122- return introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
122+ introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
123123 }
124124
125125 /// Finds a `UISlider` from a `SwiftUI.Slider`
126126 @available ( tvOS, unavailable)
127127 public func introspectSlider( customize: @escaping ( UISlider ) -> ( ) ) -> some View {
128- return introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
128+ introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
129129 }
130130
131131 /// Finds a `UIStepper` from a `SwiftUI.Stepper`
132132 @available ( tvOS, unavailable)
133133 public func introspectStepper( customize: @escaping ( UIStepper ) -> ( ) ) -> some View {
134- return introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
134+ introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
135135 }
136136
137137 /// Finds a `UIDatePicker` from a `SwiftUI.DatePicker`
138138 @available ( tvOS, unavailable)
139139 public func introspectDatePicker( customize: @escaping ( UIDatePicker ) -> ( ) ) -> some View {
140- return introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
140+ introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
141141 }
142142
143143 /// Finds a `UISegmentedControl` from a `SwiftUI.Picker` with style `SegmentedPickerStyle`
144144 public func introspectSegmentedControl( customize: @escaping ( UISegmentedControl ) -> ( ) ) -> some View {
145- return introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
145+ introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
146146 }
147147
148148 /// Finds a `UIColorWell` from a `SwiftUI.ColorPicker`
149149 @available ( iOS 14 . 0 , * )
150150 @available ( tvOS, unavailable)
151151 public func introspectColorWell( customize: @escaping ( UIColorWell ) -> ( ) ) -> some View {
152- return introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
152+ introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
153153 }
154154}
155155#endif
@@ -163,20 +163,20 @@ extension View {
163163 selector: @escaping ( IntrospectionNSView ) -> TargetView ? ,
164164 customize: @escaping ( TargetView ) -> ( )
165165 ) -> some View {
166- return inject ( AppKitIntrospectionView (
166+ inject ( AppKitIntrospectionView (
167167 selector: selector,
168168 customize: customize
169169 ) )
170170 }
171171
172172 /// Finds a `NSTableView` from a `SwiftUI.List`, or `SwiftUI.List` child.
173173 public func introspectTableView( customize: @escaping ( NSTableView ) -> ( ) ) -> some View {
174- return introspect ( selector: TargetViewSelector . ancestorOrSiblingContaining, customize: customize)
174+ introspect ( selector: TargetViewSelector . ancestorOrSiblingContaining, customize: customize)
175175 }
176176
177177 /// Finds a `NSTableCellView` from a `SwiftUI.List`, or `SwiftUI.List` child. You can attach this directly to the element inside the list.
178178 public func introspectTableViewCell( customize: @escaping ( NSTableCellView ) -> ( ) ) -> some View {
179- return introspect ( selector: TargetViewSelector . ancestorOrSiblingContaining, customize: customize)
179+ introspect ( selector: TargetViewSelector . ancestorOrSiblingContaining, customize: customize)
180180 }
181181
182182 /// Finds a `NSScrollView` from a `SwiftUI.ScrollView`, or `SwiftUI.ScrollView` child.
@@ -190,48 +190,48 @@ extension View {
190190
191191 /// Finds a `NSTextField` from a `SwiftUI.TextField`
192192 public func introspectTextField( customize: @escaping ( NSTextField ) -> ( ) ) -> some View {
193- return introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
193+ introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
194194 }
195195
196196 /// Finds a `NSTextView` from a `SwiftUI.TextView`
197197 public func introspectTextView( customize: @escaping ( NSTextView ) -> ( ) ) -> some View {
198- return introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
198+ introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
199199 }
200200
201201 /// Finds a `NSSlider` from a `SwiftUI.Slider`
202202 public func introspectSlider( customize: @escaping ( NSSlider ) -> ( ) ) -> some View {
203- return introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
203+ introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
204204 }
205205
206206 /// Finds a `NSStepper` from a `SwiftUI.Stepper`
207207 public func introspectStepper( customize: @escaping ( NSStepper ) -> ( ) ) -> some View {
208- return introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
208+ introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
209209 }
210210
211211 /// Finds a `NSDatePicker` from a `SwiftUI.DatePicker`
212212 public func introspectDatePicker( customize: @escaping ( NSDatePicker ) -> ( ) ) -> some View {
213- return introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
213+ introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
214214 }
215215
216216 /// Finds a `NSSegmentedControl` from a `SwiftUI.Picker` with style `SegmentedPickerStyle`
217217 public func introspectSegmentedControl( customize: @escaping ( NSSegmentedControl ) -> ( ) ) -> some View {
218- return introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
218+ introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
219219 }
220220
221221 /// Finds a `NSTabView` from a `SwiftUI.TabView`
222222 public func introspectTabView( customize: @escaping ( NSTabView ) -> ( ) ) -> some View {
223- return introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
223+ introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
224224 }
225225
226226 /// Finds a `NSButton` from a `SwiftUI.Button`
227227 public func introspectButton( customize: @escaping ( NSButton ) -> ( ) ) -> some View {
228- return introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
228+ introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
229229 }
230230
231231 /// Finds a `NSColorWell` from a `SwiftUI.ColorPicker`
232232 @available ( macOS 11 . 0 , * )
233233 public func introspectColorWell( customize: @escaping ( NSColorWell ) -> ( ) ) -> some View {
234- return introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
234+ introspect ( selector: TargetViewSelector . siblingContaining, customize: customize)
235235 }
236236}
237237#endif
0 commit comments