Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Transitioning from Introspect to SwiftUI-Introspect: help Needed #403

Unanswered
Meshaal-Alruwaili asked this question in Q&A
Discussion options

How can i create a similar function in SwiftUI-Introspect.

 private func tableView(entry: UIView) -> UITableView? {
 
 // Search in ancestors
 if let tableView = Introspect.findAncestor(ofType: UITableView.self, from: entry) {
 return tableView
 }
 
 guard let viewHost = Introspect.findViewHost(from: entry) else {
 return nil
 }
 
 // Search in siblings
 return Introspect.previousSibling(containing: UITableView.self, from: viewHost)
 }
You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /