Post

Replies

Boosts

Views

Activity

Reply to Disable keyboard avoidance for SwiftUI view
I'm going to see if this is fixed in Xcode 12.3. The gist that @steipete linked to fixed another (slightly unrelated) issue I was having, which was an infinite layout crash that I was seeing on xcode 12.1 on iOS14 (only on notched devices): Pin UIHostingController's view to the edges of a parent UIView Translate that parent UIView to be partially below the screen Resize the SwiftUI content to be a larger size than it was originally You'll get an infinite layoutSubviews crash without that slightly terrible gist. SwiftUI can't seem to handle having partially off-screen content when safeAreas are in the mix. There's something about SwiftUI's layout system that tries to automatically avoid those areas of the screen which causes lots of issues.
Jan ’21
Reply to Xcode 11 Beta 7/Catalina Beta 7 crash with ObservableObject
Hey, I was able to get this working by importing Combine in the file that declared the public ObservableObject - no NSObject subclassing needed. Once I did this and added a public init... it worked! Give it a shot. Just a note on subclassing NSObject, I'd avoid it, although my framework compiled fine with it, it failed to compile properly when I had another app pull in that framework.
Aug ’20