Skip to content

Commit eb5ab42

Browse files
committed
Fixes attribute graph cycle errors in Xcode 13.
I'd hope to avoid this brute-force approach but this seems to be the only way to ensure there aren't nested view updates triggered by changing the textfield responder state.
1 parent f1820d0 commit eb5ab42

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Demo Project/ResponsiveTextFieldDemo.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@
281281
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
282282
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
283283
CODE_SIGN_STYLE = Automatic;
284-
DEVELOPMENT_TEAM = ZZVQ8B5T69;
284+
DEVELOPMENT_TEAM = Y4FPFWU22N;
285285
ENABLE_PREVIEWS = YES;
286286
INFOPLIST_FILE = ResponsiveTextFieldDemo/Info.plist;
287287
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
@@ -302,7 +302,7 @@
302302
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
303303
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
304304
CODE_SIGN_STYLE = Automatic;
305-
DEVELOPMENT_TEAM = ZZVQ8B5T69;
305+
DEVELOPMENT_TEAM = Y4FPFWU22N;
306306
ENABLE_PREVIEWS = YES;
307307
INFOPLIST_FILE = ResponsiveTextFieldDemo/Info.plist;
308308
IPHONEOS_DEPLOYMENT_TARGET = 14.0;

Sources/ResponsiveTextField/ResponsiveTextField.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,9 @@ extension ResponsiveTextField: UIViewRepresentable {
344344

345345
switch (uiView.isFirstResponder, firstResponderDemand?.wrappedValue) {
346346
case (true, .shouldResignFirstResponder):
347-
uiView.resignFirstResponder()
347+
RunLoop.main.schedule { uiView.resignFirstResponder() }
348348
case (false, .shouldBecomeFirstResponder):
349-
uiView.becomeFirstResponder()
349+
RunLoop.main.schedule { uiView.becomeFirstResponder() }
350350
case (_, nil):
351351
// If there is no demand then there's nothing to do.
352352
break

0 commit comments

Comments
 (0)