-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Remove redundant #available(iOS 13, *) checks
#19513
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
Changes from 3 commits
d209f93
da7bd21
220efe0
6d49db7
cd07203
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -96,14 +96,8 @@ private extension MainShareViewController { | |
|
|
||
| let shareNavController = UINavigationController(rootViewController: editorController) | ||
|
|
||
| if #available(iOS 13, *), editorController.originatingExtension == .saveToDraft { | ||
| // iOS 13 has proper animations and presentations for share and action sheets. So the `else` case should be removed when iOS 13 is minimum. | ||
| // We need to make sure we don't end up with stacked modal view controllers by using this: | ||
| shareNavController.modalPresentationStyle = .overFullScreen | ||
| } else { | ||
| shareNavController.transitioningDelegate = extensionTransitioningManager | ||
| shareNavController.modalPresentationStyle = .custom | ||
| } | ||
| // We need to make sure we don't end up with stacked modal view controllers by using this: | ||
| shareNavController.modalPresentationStyle = .overFullScreen | ||
|
||
|
|
||
| present(shareNavController, animated: true) | ||
| } | ||
|
|
||
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.
@mokagio you still need to keep this
elseclause and code path for the case when the source is not the SaveToDraft extensionThere 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.
See why I need tests?!?!
Uh oh!
There was an error while loading. Please reload this page.
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.
Oh wait, and now I just read the
// code commentthat was there before your change, and that said:So maybe you were right to remove the
elseclause after all! 🤔 (so sorry for the back-and-forth 😅 I should be more mindful of code comments in diffs)Though that comment still begs the question, if we remove that
elseclause, are we also supposed to remove theif editorController.originatingExtension == .saveToDraftas well, and use the samemodalPresentationStyle = .customfor all cases? Or should we still keep theifcondition and only use.customfor SaveToDraft but not to other cases?@bjtitus, as the author of that code back in #13146 (even if this was 3 years ago and you moved to other products since…), maybe you remember?
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.
The release notes in that PR list
Skimming the PR description, I think the
editorController.originatingExtension == .saveToDraftcheck is intentional and required.I'll verify the behavior for the two extensions and in both versions of the code and report. Stay tuned.
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.
With the code at
cd07203(#19513), I'm getting the followingSave as Draft
Share
Share doesn't look right. Might need more work. The first thing I'll try will be removing the
elsebranch and add some break points. I'm also not sure why I'm getting that error, given the app was setup alright.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.
#19700