Skip to content
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

[iOS Demo App] Fix retain cycles in bottom sheet demo #2116

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,16 @@ class BottomSheetDemoController: DemoController {
secondarySheetController.isFlexibleHeight = true
secondarySheetController.allowsSwipeToHide = true

let dismissButton = Button(primaryAction: UIAction(title: "Dismiss", handler: { _ in
secondarySheetController.setIsHidden(true, animated: true)
let dismissButton = Button(primaryAction: UIAction(title: "Dismiss", handler: { [weak secondarySheetController] _ in
secondarySheetController?.setIsHidden(true, animated: true)
}))

dismissButton.style = .accent
dismissButton.translatesAutoresizingMaskIntoConstraints = false
sheetContentView.addSubview(dismissButton)

let anotherOneButton = Button(primaryAction: UIAction(title: "Show another sheet", handler: { _ in
self.showTransientSheet()
let anotherOneButton = Button(primaryAction: UIAction(title: "Show another sheet", handler: { [weak self] _ in
self?.showTransientSheet()
}))
anotherOneButton.translatesAutoresizingMaskIntoConstraints = false
sheetContentView.addSubview(anotherOneButton)
Expand Down
Loading