Remove strong references of self in closures#765
Merged
etoledom merged 5 commits intoetoledom/uikit-sheet-presentationfrom May 28, 2025
Merged
Remove strong references of self in closures#765etoledom merged 5 commits intoetoledom/uikit-sheet-presentationfrom
etoledom merged 5 commits intoetoledom/uikit-sheet-presentationfrom
Conversation
etoledom
commented
May 28, 2025
Comment on lines
295
to
299
| lazy var imageEditorToggle: UISegmentedControl = { | ||
| let control = UISegmentedControl(items: [ | ||
| UIAction.init(title: "Default Image Editor") { _ in self.useCustomImageEditor = false }, | ||
| UIAction.init(title: "Custom Image Editor") { _ in self.useCustomImageEditor = true }, | ||
| UIAction.init(title: "Default Image Editor") { [weak self] _ in self?.useCustomImageEditor = false }, | ||
| UIAction.init(title: "Custom Image Editor") { [weak self] _ in self?.useCustomImageEditor = true }, | ||
| ]) |
Contributor
Author
There was a problem hiding this comment.
These are an extra retention on DemoQuickEditorViewController
etoledom
commented
May 28, 2025
Comment on lines
21
to
28
| true | ||
| } set: { isPresented in | ||
| } set: { [weak self] isPresented in | ||
| Task { @MainActor in | ||
| guard !isPresented else { return } | ||
| self.dismiss(animated: true) | ||
| self.onDismiss?() | ||
| self?.dismiss(animated: true) | ||
| self?.onDismiss?() | ||
| } | ||
| } |
Contributor
Author
There was a problem hiding this comment.
This was the main culprit
|
| App Name | Gravatar Prototype Build | |
| Build Number | 2385 | |
| Version | PR #765 | |
| Bundle ID | com.automattic.gravatar-sdk-demo-uikit.prototype-build | |
| Commit | d08b5e9 | |
| Installation URL | 3fqucm57gdm20 |
etoledom
commented
May 28, 2025
Comment on lines
111
to
117
| func updateDetents() { | ||
| if let sheet = sheetPresentationController { | ||
| sheet.animateChanges { | ||
| sheet.animateChanges { [weak self] in | ||
| guard let self else { return } | ||
| sheet.detents = QEDetent.detents( | ||
| for: scopeOption, | ||
| intrinsicHeight: sheetHeight, |
Contributor
Author
There was a problem hiding this comment.
This I think is doing nothing 🤔
`.assign(to: \.shouldDisplayNoSelectedAvatarWarning, on: self)` captures self strongly
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Closes #
Description
This PR fixes a retain cycle on
QuickEditorViewController, and inDemoQuickEditorViewControllerTesting Steps
QuickEditorViewController,InnerHeightUIHostingController, orDemoQuickEditorViewControllerin the graph.