TabBarController
This commit is contained in:
parent
ea9a33635d
commit
5034d7dab8
|
@ -27,7 +27,7 @@ public enum Introspect {
|
|||
return nil
|
||||
}
|
||||
|
||||
for subview in superview.subviews[entryIndex...superview.subviews.count - 1] {
|
||||
for subview in superview.subviews[entryIndex..<superview.subviews.endIndex] {
|
||||
if let typed = findChild(ofType: type, in: subview) {
|
||||
return typed
|
||||
}
|
||||
|
@ -176,6 +176,13 @@ extension View {
|
|||
))
|
||||
}
|
||||
|
||||
public func introspectTabBarController(customize: @escaping (UITabBarController) -> ()) -> some View {
|
||||
return background(IntrospectionViewController(
|
||||
selector: { $0.tabBarController },
|
||||
customize: customize
|
||||
))
|
||||
}
|
||||
|
||||
public func introspectTextField(customize: @escaping (UITextField) -> ()) -> some View {
|
||||
return self.background(IntrospectionView(
|
||||
selector: { introspectionView in
|
||||
|
|
|
@ -8,6 +8,9 @@ struct ContentView: View {
|
|||
ListExample()
|
||||
.tabItem { Text("List") }
|
||||
.tag(0)
|
||||
.introspectTabBarController { tabBarController in
|
||||
tabBarController.tabBar.layer.backgroundColor = UIColor.green.cgColor
|
||||
}
|
||||
ScrollViewExample()
|
||||
.tabItem { Text("ScrollView") }
|
||||
.tag(1)
|
||||
|
|
|
@ -10,19 +10,13 @@ SwiftUI | UIKit | Introspect
|
|||
List | UITableView | `.introspectTableView()` on a list child
|
||||
ScrollView | UIScrollView | `.introspectScrollView()` on a scroll view child
|
||||
NavigationView | UINavigationController | `.introspectNavigationController()` on a navigation child
|
||||
TabbedView | UITabBarController | `.introspectTabBarController()` on a tab bar child
|
||||
TextField | UITextField | `.introspectTextField()`
|
||||
Toggle | UISwitch | `.introspectSwitch()`
|
||||
Slider | UISlider | `.introspectSlider()`
|
||||
Stepper | UIStepper | `.introspectStepper()`
|
||||
DatePicker | UIDatePicker | `.introspectDatePicker()`
|
||||
|
||||
|
||||
### Not implemented
|
||||
|
||||
SwiftUI | UIKit
|
||||
--- | ---
|
||||
TabbedView | UITabBarController
|
||||
|
||||
### Cannot implement
|
||||
|
||||
SwiftUI | Why
|
||||
|
|
Loading…
Reference in New Issue