Skip to content

Commit

Permalink
Fixes attribute graph cycle errors in Xcode 13.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lukeredpath committed Oct 29, 2021
1 parent f1820d0 commit eb5ab42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = ZZVQ8B5T69;
DEVELOPMENT_TEAM = Y4FPFWU22N;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = ResponsiveTextFieldDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
Expand All @@ -302,7 +302,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = ZZVQ8B5T69;
DEVELOPMENT_TEAM = Y4FPFWU22N;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = ResponsiveTextFieldDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
Expand Down
4 changes: 2 additions & 2 deletions Sources/ResponsiveTextField/ResponsiveTextField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,9 @@ extension ResponsiveTextField: UIViewRepresentable {

switch (uiView.isFirstResponder, firstResponderDemand?.wrappedValue) {
case (true, .shouldResignFirstResponder):
uiView.resignFirstResponder()
RunLoop.main.schedule { uiView.resignFirstResponder() }
case (false, .shouldBecomeFirstResponder):
uiView.becomeFirstResponder()
RunLoop.main.schedule { uiView.becomeFirstResponder() }
case (_, nil):
// If there is no demand then there's nothing to do.
break
Expand Down

0 comments on commit eb5ab42

Please sign in to comment.