-
Notifications
You must be signed in to change notification settings - Fork 44
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
[WIP DNR] Allow wrapping screens to guarantee a described view controller #159
base: main
Are you sure you want to change the base?
Conversation
0fe89cc
to
e93a6ca
Compare
e93a6ca
to
10cec95
Compare
* origin/main: Changed expectPublisher/expectTask to be expect Updatd development podspec Added Concurrency Testing
/// if isLoading { | ||
/// return LoadingScreen(with: ...) | ||
/// } else if isEmpty { | ||
/// return ContentScreen(with ...) |
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.
returns are backwards
let content = content() | ||
|
||
if let content = content as? Self { | ||
self = content |
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.
Oops, this drops the transition
|
||
guard newPreferredContentSize != preferredContentSize else { return } | ||
|
||
preferredContentSize = newPreferredContentSize | ||
} | ||
|
||
private func currentViewControllerChanged() { |
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 think this needs update for iOS 16 and 17
|
||
#if canImport(UIKit) | ||
|
||
/// Used by `AnyContentScreen` and `DescribedViewController` to the backing view |
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.
- Some words missing here
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.
- Add: Tests for animated and non-animated transitions
This PR introduces a wrapper screen that transitions its content when the underlying VC type changes; which was lost as a "standard" thing when we removed
DescribedViewController
usage from our apps – since it effectively doubled the VC hierarchy depth. Some folks still want this behavior, so giving them a more concrete way to achieve it.AnyContentScreen
, which is a screen-based wrapper aroundDescribedViewController
. If the containing screen's VC changes, it'll transition per the added transition type...DescribedViewController
when it replaces its content. This in general probably always should have been a thing; since without an animation, things look pretty sudden / abrupt.Checklist