-
Notifications
You must be signed in to change notification settings - Fork 59
Added ContentWidth #58
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
StackViewController.xcodeproj/xcshareddata/xcschemes/Example.xcscheme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
StackViewController.xcodeproj/xcshareddata/xcschemes/StackViewController.xcscheme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| // | ||
| // ContentWidth.swift | ||
| // StackViewController | ||
| // | ||
| // Created by Devin McKaskle on 10/4/21. | ||
| // Copyright © 2021 Seed Platform, Inc. All rights reserved. | ||
| // | ||
|
|
||
| @objc public enum ContentWidth: Int { | ||
| case matchScrollViewWidth | ||
| case matchReadableContentGuideWidth | ||
|
|
||
| public mutating func toggle() { | ||
| self = ContentWidth(rawValue: rawValue + 1) ?? .matchScrollViewWidth | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should insets vary by size class?
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.
I actually ran into problems with the
contentInset. In the example app, there is aStackViewControllerinside anotherStackViewController. When the size class changed, thecontentInsetfor the scroll view for the childStackViewControllerwas reset to zero. The best I could figure out was that UIKit was reseting thecontentInset. Even when I resized the window to be back to its original size, it was at zero. I put breakpoints in thedidSetand it never hit the breakpoint. I spent a good amount of time trying to figure it out. I never did figure it out. I decided to move on since I had already spent so much time on it and it wasn't made worse w/ my changes. It had always been like that, we just never noticed because we weren't changing the window size.Note: I never tested to see if this was a problem with the outer stack VC/scroll view. I don't think it ever had a contentInset so if the same thing happens there, it never would have surfaced there.
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.
All that being said, I can see how different insets for each size class would be beneficial. We don't need it and as far as I know there haven't been any requests for it though.
Since you gave the approval, I'm going to assume it's good to merge as is. If you'd like me to work on any changes to the
contentInset, let me know and I can work on it in a separate PR.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.
One last note @louoso, if the content inset issue I mentioned above seems worth fixing to you, I have ideas on how to fix it. As far as I know, the bug as it exists now shouldn't actually impact Formalist or our own apps because I don't think we make use of
contentInset.