Skip to content

Commit 1685cdc

Browse files
committed
Small weak var change in ShowSmilieKeyboardCommand.swift to successfully build under Xcode 26.2. Remove weak var declaration from outside the closure to inside, maintaining weak reference intent of original code.
1 parent 54858e1 commit 1685cdc

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

App/Composition/ShowSmilieKeyboardCommand.swift

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,30 +68,29 @@ final class ShowSmilieKeyboardCommand: NSObject {
6868

6969
// Dismiss keyboard before showing smilie picker
7070
textView.resignFirstResponder()
71-
72-
weak var weakTextView = textView
73-
let pickerView = SmiliePickerView(dataStore: smilieKeyboard.dataStore) { [weak self] smilie in
71+
72+
let pickerView = SmiliePickerView(dataStore: smilieKeyboard.dataStore) { [weak self, weak textView] smilie in
7473
self?.insertSmilie(smilie)
7574
// Delay keyboard reactivation to ensure smooth animation after sheet dismissal
7675
// Without this delay, the keyboard animation can conflict with sheet dismissal
7776
DispatchQueue.main.async {
78-
weakTextView?.becomeFirstResponder()
77+
textView?.becomeFirstResponder()
7978
}
8079
}
81-
.onDisappear {
80+
.onDisappear { [weak textView] in
8281
// Delay keyboard reactivation when view disappears (handles Done button case)
8382
// This ensures the sheet dismissal animation completes before keyboard appears
8483
DispatchQueue.main.async {
85-
weakTextView?.becomeFirstResponder()
84+
textView?.becomeFirstResponder()
8685
}
8786
}
8887
.themed()
89-
88+
9089
let hostingController = UIHostingController(rootView: pickerView)
91-
hostingController.modalPresentationStyle = .pageSheet
92-
90+
hostingController.modalPresentationStyle = UIModalPresentationStyle.pageSheet
91+
9392
if let sheet = hostingController.sheetPresentationController {
94-
sheet.detents = [.medium(), .large()]
93+
sheet.detents = [UISheetPresentationController.Detent.medium(), UISheetPresentationController.Detent.large()]
9594
sheet.prefersGrabberVisible = true
9695
sheet.preferredCornerRadius = 20
9796
sheet.delegate = self

0 commit comments

Comments
 (0)