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

AttributeGraph: cycle detected through attribute 234608 #11

Open
solkpolk opened this issue Oct 21, 2021 · 1 comment
Open

AttributeGraph: cycle detected through attribute 234608 #11

solkpolk opened this issue Oct 21, 2021 · 1 comment

Comments

@solkpolk
Copy link

solkpolk commented Oct 21, 2021

When I have an iTextField that's first responder it creates attribute warnings. I added a Symbolic breakpoint with symbol print_cycle. It seems that Xcode doesn't like changing first responder they way its done below.

public struct iTextField: UIViewRepresentable {
...
public func updateView {
...
if isEditing.wrappedValue {
    textField.becomeFirstResponder() // <- Causes the warning
} else {
    textField.resignFirstResponder()
}

}}
@cefiro666
Copy link

cefiro666 commented Dec 30, 2021

@solkpolk For your information!
I forked the repository and fixed this part of the code for myself. Just wrapped the whole structure above in DispatchQueue.main.async.

DispatchQueue.main.async {
if isEditing.wrappedValue {
textField.becomeFirstResponder() // <- Causes the warning
} else {
textField.resignFirstResponder()
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants