Post not yet marked as solved
What is the solution here? I’m running into the same problem.
Post not yet marked as solved
I’m seeing the same behavior on the released version of Xcode 15.2. It works just fine on the iOS 17.0 simulator, but 17.2 crashes on launch with "EXC_BAD_ACCESS".
usesBottomSafeArea is a new property introduced in iOS 17 to address this. Watch Keep up with the keyboard for more info.
view.keyboardLayoutGuide.usesBottomSafeArea = false
NSLayoutConstraint.activate([
collectionView.topAnchor.constraint(equalTo: view.topAnchor),
collectionView.bottomAnchor.constraint(equalTo: view.keyboardLayoutGuide.topAnchor),
collectionView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
collectionView.trailingAnchor.constraint(equalTo: view.trailingAnchor)
])
Post not yet marked as solved
I have also not been able to get AppIntentsPackage working. I’m copying and pasting the example from Apples documentation, but no shortcuts appear in the shortcuts app.
We are having the exact same problem. Only lower iOS 15 physical devices are effected, it causes a crash, and it seems to do with Swift Concurrency. From our testing it appears that async let may be apart of the issue. To solve this problem in the short term, we also had to put out a hot fix to revert back to Xcode 14.2.
Post not yet marked as solved
I’m also having this issue (Instruments 14.0.1). Did you ever find a fix?
Post not yet marked as solved
I ended up having to create a UICollectionViewCompositionalLayout subclass, but the solution works really well. You can see the complete solution here.
Post not yet marked as solved
You have to add a large delay for @FocusState to work inside of a sheet. Here is a basic example.
enum FocusableField: Hashable {
case email
case password
}
struct ContentView: View {
@State private var show = false
var body: some View {
Button("Show"){
show.toggle()
}
.sheet(isPresented: $show){
SheetView()
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
.previewLayout(.sizeThatFits)
}
}
struct SheetView: View{
@State private var email = ""
@State private var password = ""
@FocusState private var focus: FocusableField?
var body: some View{
NavigationView {
Form {
TextField("email", text: $email, prompt: Text("email"))
.focused($focus, equals: .email)
SecureField("password", text: $password, prompt: Text("password"))
.focused($focus, equals: .password)
}
.navigationTitle("Sign in")
.onAppear {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.6) {
focus = .email
}
}
}
}
}
As thisisnotmikey said, you can check the size of the data and see if its 42 bytes, however this also doesn't work because anytime you use the eraser, it adds to the data size. So even if you have a blank canvas and only use the erase, the data size will ballon.
canvasView.drawing.strokes.isEmpty seems to work well. So does canvasView == CGRect(origin: CGPoint(x: CGFloat.infinity, y: CGFloat.infinity), size: .zero).
Post not yet marked as solved
I've been having this issue to an I found that changing from this
struct Test_Previews: PreviewProvider {
static var previews: some View {
Test()
.environment(\.managedObjectContext, CoreDataManager.shared.context)
}
}
to this has been the solution for me. No idea why this works, but it does.
struct Test_Previews: PreviewProvider {
static var previews: some View {
let context = CoreDataManager.shared.context
return Test()
.environment(\.managedObjectContext, context)
}
}
Post not yet marked as solved
I’m getting this error on Xcode Version 12.2 beta 3 (12B5035g) with iOS 14.2 beta 4. It works partially in the simulator but not on a real device.
Post not yet marked as solved
I’m having this issue in the iOS 14 GM.
This is happening to me on Xcode 12 beta 4 with iOS 14 beta 4, but only on a device.