Post

Replies

Boosts

Views

Activity

Reply to 'iOS + Mac' or 'iOS/Catalyst' universal app?
Last year I started a bigger project with Catalyst, because I didn't want to write code twice (as some controls didn't exist at this time, so I had to rely on UIKit... therefore I didn't want to write code with UIKit and AppKit to support both). This year now there are some more controls, but still you cannot build an app 100 % with SwiftUI, unfortunately. I'm still thinking about how I will do this now, if I should continue using Catalyst or switch to the Multiplatform template. Are there any official longterm plans? I think if Apple is now pushing the iOS frameworks to macOS and if now the design of macOS is getting closer to iOS/iPadOS, there will be hopefully in the end no need for Catalyst anymore?
Jun ’20
Reply to SwiftUI First Responder - TextField
Setting the focus/firstResponder on a control improves the user experience and is in my eyes absolutely essential. I expected that SwiftUI will support this from now on. Very disappointing, that it doesn't do it. But there is some time until the final release and I hope that Apple will listen to our wishes. I would be very happy if SwiftUI would support it. Would be nice to do something like this: struct ContentView: View { @Environment(\.firstResponder) private var firstResponder: ObjectIdentifier @State var text1: String = "" @State var text2: String = "" var body: some View { VStack { TextField("...", text: self.$text1) .id("TF1") TextField("...", text: self.$text2) .id("TF2") HStack { Button("Focus 1") { self.firstResponder = "TF1" } Button("Focus 2") { self.firstResponder = "TF2" } } } } }
Jun ’20