IQKeyboardManager icon indicating copy to clipboard operation
IQKeyboardManager copied to clipboard

disable IQKeyboardManager inside swiftui

Open seniorAyman opened this issue 1 year ago • 3 comments

Describe the bug I want to disable IQKeyboardManager inside swiftui view

To Reproduce Steps to reproduce the behavior:

  1. I write IQKeyboardManager.shared.enable = false in onAppear
  2. 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.

seniorAyman avatar Mar 24 '24 14:03 seniorAyman

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

tapan-torinit avatar Apr 08 '24 13:04 tapan-torinit

Write it inside the task instead of onAppear may fix the issue I believe.

hackiftekhar avatar May 03 '24 08:05 hackiftekhar

Task { @MainActor in // your code here }

alessdiimperio avatar Jun 13 '24 17:06 alessdiimperio