-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Introspector in iOS 14 not working for ScrollView (#55) #56
Conversation
Been using this fix in production on a ScrollView and List. It works in both iOS 13 and 14. |
Are you able to change the |
I haven't tried (though I can in a bit). I am using it successfully to hide
list separators and disable scrolling in Lists and ScrollViews.
…On Sun, Sep 27, 2020 at 11:21 AM Gian Frangiamore ***@***.***> wrote:
Been using this fix in production on a ScrollView and List. It works in
both iOS 13 and 14.
Are you able to change the sectionFooterHeight for a List/TableVIew? The
code gets called but the height never changes until the list is updated
(such as adding or deleting something in the list).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#56 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJVI7LR3MKUQO7AG7GEDR7TSH5J7TANCNFSM4RZC4DAQ>
.
|
Does this work for you?
I've checked out the specific commit. The code above doesn't remove the separator inset. Am I doing something wrong? |
Looks like in iOS 14 SwiftUI is handling the separator on its own and not respecting |
I was actually just using the line separator as an example. What I wanted to use this library for was to reduce the height of the section footer/header. I've noticed that if you call Have you got any suggestions? |
Hi, this fix works for my use cases... Waiting for this to be pulled to master... |
Somehow this doesn't work for me on device/simulator. But works in SwiftUI Previews 🤷♂️🙈 |
@lucastimeless Thanks a ton for looking into this! I adapted your code and created 2 different methods instead. It's now fixed in master, and we can close both this PR and #55 . See 6ddd059 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checking
Looks like in iOS 14 the sibling view is the UIScrollView, as opposed to a ViewHost containing a UIScrollView. Added a check to see if the sibling itself is a UIScrollView.
The iOS 14 SwiftUI ScrollView type is as follows:
<SwiftUI.HostingScrollView: 0x7fd3ae835200; baseClass = UIScrollView; frame = (84.5 0; 151.5 568); anchorPoint = (0, 0); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x600001de89f0>; layer = <CALayer: 0x60000134e060>; contentOffset: {0, -20}; contentSize: {151.5, 1746.5}; adjustedContentInset: {20, 0, 0, 0}>
Tested using a simple example app: