Skip to content

Question: Keeping UIView instances outside the closure #231

Closed Answered by davdroman
oriolpregona asked this question in Q&A
Discussion options

You must be logged in to vote

@oriolpregona this is totally fine. I use an approach similar to yours for UINavigationController in my https://github.com/davdroman/swiftui-navigation-transitions library.

As a side note, note there's a newly released module that you should if possible prefer using, as follows:

import SwiftUIIntrospect

ScrollView {
    MyListView()
}
.introspect(.scrollView, on: .iOS(.v13, .v14, .v15, .v16), .tvOS(.v13, .v14, .v15, .v16)) { scrollView in
    self.myScrollView = scrollView
}

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@davdroman
Comment options

Answer selected by davdroman
Comment options

You must be logged in to vote
2 replies
@davdroman
Comment options

@davdroman
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #230 on June 02, 2023 11:51.