From a8bb5062f1a874d388e00a07857a053ae0961320 Mon Sep 17 00:00:00 2001 From: clover caruso Date: Mon, 12 Oct 2026 11:19:53 -0700 Subject: [PATCH] fix(ios): release welcome name observers with their prompt Use the text field editing action with weak field and Continue-action captures instead of a process-retained notification subscription. Refs #75 Assisted-by: gpt-6.1-sol --- apps/ios/Snowbound/Prototypes.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/ios/Snowbound/Prototypes.swift b/apps/ios/Snowbound/Prototypes.swift index 489f174c6979dcae2baa848c67fa7388a8906096..e4b9cab6eb09341cc0fcecc792702eb07c86c832 100644 --- a/apps/ios/Snowbound/Prototypes.swift +++ b/apps/ios/Snowbound/Prototypes.swift @@ -63,9 +63,10 @@ extension Prototype { field.placeholder = "Name" field.textContentType = .name field.autocapitalizationType = .words - NotificationCenter.default.addObserver( - forName: UITextField.textDidChangeNotification, object: field, queue: .main - ) { _ in save.isEnabled = !(field.text ?? "").trimmingCharacters(in: .whitespaces).isEmpty } + field.addAction( + UIAction { [weak field, weak save] _ in + save?.isEnabled = !(field?.text ?? "").trimmingCharacters(in: .whitespaces).isEmpty + }, for: .editingChanged) } alert.addAction(UIAlertAction(title: "Not Now", style: .cancel)) alert.addAction(save) -- 2.54.0