IQKeyboardManager
IQKeyboardManager copied to clipboard
disable IQKeyboardManager inside swiftui
Describe the bug I want to disable IQKeyboardManager inside swiftui view
To Reproduce Steps to reproduce the behavior:
- I write IQKeyboardManager.shared.enable = false in onAppear
- i get a compiler error "Main actor-isolated class property 'shared' can not be mutated from a non-isolated context"
Versions
Xcode: 15.1 Mac OS: 14.2 Simulator/Device: 15 pro max Simulator/Device Name: iPhone 14 Pro Max Library Version: 7.0.2
Additional context Add any other context about the problem here.
Hey any update on it? I just install IQKeyboard swift library and getting the same error in UIKit. The same things worked in IQKeyboard obj-c library
Write it inside the task instead of onAppear may fix the issue I believe.
Task { @MainActor in // your code here }