Created
June 6, 2020 17:24
-
-
Save kkebo/49c614220af0db81771ada61a2aa1f8d to your computer and use it in GitHub Desktop.
SwiftUI TextField 日本語入力問題
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PlaygroundSupport | |
import SwiftUI | |
final class ContentViewModel { | |
@Published var text = "" | |
} | |
extension ContentViewModel: ObservableObject {} | |
struct ContentView { | |
@ObservedObject var viewModel = ContentViewModel() | |
@State var text = "" | |
} | |
extension ContentView: View { | |
var body: some View { | |
VStack { | |
TextField("State", text: self.$text) | |
TextField("ObservedObject", text: self.$viewModel.text) | |
} | |
} | |
} | |
PlaygroundPage.current.setLiveView(ContentView()) |
iPadOS 14 Developer Beta 1 でも変化なし。
iPadOS 14 Developer Beta 5 で修正されていることを確認.(iOS SDK 13 & iOS SDK 14)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@State
なプロパティをバインドしたときは問題ないけど、ObservableObject
の@Published
なプロパティをバインドしたときだけ日本語入力ができない問題が発生する。(iPadOS 13.4, 13.5, 13.5.5 Developer Beta 1 で確認)再現動画: https://twitter.com/_kebo/status/1269323076912611328?s=21