Posts

Post not yet marked as solved
3 Replies
431 Views
I want to target iOS 15 and I get deprecation warnings in some CloudKit properties. I was using modifyRecordsCompletionBlock on CKModifyRecordsOperation and now I get: 'modifyRecordsCompletionBlock' was deprecated in iOS 15.0: Use modifyRecordsResultBlock instead However with modifyRecordsCompletionBlock I'd get an array of the successfully modified records as input for the block which I'd in turn use for updating my local DB, whereas the input for modifyRecordsResultBlock is Result<Void, Error>. Basically I'm being told to use a different closure where I get no data and I don't know how to complete my local DB updates. Any ideas?
Posted
by gbuela.
Last updated
.
Post marked as solved
1 Replies
139 Views
So actionSheet is deprecated in favor of confirmationDialog. When trying to migrate I'm noticing that the latter doesn't work when the view is in a child view controller! I have created a simple project to demonstrate the issue. https://github.com/gbuela/cddemo I have a SheetView and a DialogView, they display a button to try either API. In the ViewController, these are loaded into UIHostingController's and added as children into two UIView's. Only SheetView works. I added a Pop Up button to alternatively load DialogView in a pop up, in this context it is not a child view controller and it works. Is this simply a SwiftUI bug or do I need to do something else to make it work?
Posted
by gbuela.
Last updated
.
Post marked as solved
1 Replies
1k Views
Using Xcode 11 beta 7, I'm getting an unexpected EXC_BAD_INSTRUCTION crash with this very simple view. It manages a list where you can add and delete items. The list starts off empty, and the crash occurs after you add any items and delete them so that the list is empty again.The conditional rendering of something different when the list is empty (if items.count == 0...) seems to have something to do, because if I unconditionally render a List there is no crash. Yet I see no issue with the code as it is. Note that right before crashing, Text("empty") is correctly rendered.Any ideas...?struct TestView: View { @State var items: [Int] = [] var body: some View { VStack { Button(action: { self.add() }) { Text("Add") } if items.count == 0 { Text("empty") } else { List { ForEach(items, id: \.self) { item in Text("item #\(item)") } .onDelete(perform: { self.delete(offset: $0.first! )}) } } } } func delete(offset: Int) { DispatchQueue.main.async { self.items.remove(at: offset) } } func add() { DispatchQueue.main.async { self.items.append(self.items.count) } } }
Posted
by gbuela.
Last updated
.