I'm trying to use UITableViewDiffableDataSource to implement a UITableView which supports reordering.
Firstly, I set tableView.isEditing = true.
Then I subclassed UITableViewDiffableDataSource in order to override func tableView(_: UITableView, canMoveRowAt _: IndexPath) -> Bool however it does not work.
After that, I also override func tableView(_: UITableView, canEditRowAt _: IndexPath) -> Bool and the reorder control showed up.
However, the leading delete button cannot be hidden. So I wrote this code:
override func tableView(_: UITableView,
editingStyleForRowAt _: IndexPath) -> UITableViewCell.EditingStyle
{
.none // Disable the delete button BUT there's unexpected left indent
}
Unfortunately, the left indent for the delete still keeps.
So I add this kind of code to disable the leading indent:
cell.shouldIndentWhileEditing = false // Code to disable left indent does not work at all
But it does not work at all.
Anything I can do?
I published all the code for reproduction:
DiffableDataSourceTableViewEditingDemo@GitHub - https://developer.apple.com/forums/content/attachment/023fca8c-c373-464b-9162-38ea06b0d3d5
Post
Replies
Boosts
Views
Activity
I'm seeing a strange crash only can repro on iOS 14 with debug mode...
Anything I can do to work around it?
Demo project:
https://github.com/imWildCat/GetOpaqueTypeMetadataSwiftUICrash
Date/Time: 2022-03-24 10:11:13.6158 +0800
Launch Time: 2022-03-24 10:11:13.5675 +0800
OS Version: iPhone OS 14.4 (18D52)
Release Type: User
Baseband Version: 1.42.03
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Description: DYLD, dyld: Using shared cache: C784A723-0833-38DE-AC50-E2ECDCC7D4B4 | dependent dylib '@rpath/Alamofire.framework/Alamofire' not found for '/private/var/containers/Bundle/Application/F07FEC26-71CE-4562-BE1E-F26C87EAFC94/AppName.app/AppName'. chained fixups, seg_count exceeds number of segments
Highlighted by Thread: 0
Backtrace not available
Unknown thread crashed with ARM Thread State (64-bit):
x0: 0x0000000000000006 x1: 0x0000000000000001 x2: 0x000000016dae6030 x3: 0x000000000000009b
x4: 0x000000016dae5c30 x5: 0x0000000000000000 x6: 0x0000000000000000 x7: 0x0000000000000000
x8: 0x0000000000000020 x9: 0x0000000000000009 x10: 0x0000000000000001 x11: 0x00000000000000a7
x12: 0x0000000000000023 x13: 0x0000000000000008 x14: 0x0000000000000033 x15: 0x0000000000000038
x16: 0x0000000000000209 x17: 0x00000001026c17b4 x18: 0x0000000000000000 x19: 0x0000000000000000
x20: 0x000000016dae5c30 x21: 0x000000000000009b x22: 0x000000016dae6030 x23: 0x0000000000000001
x24: 0x0000000000000006 x25: 0x000000016dae68f8 x26: 0x00000001026e8778 x27: 0x00000001026e8000
x28: 0x0000000000000000 fp: 0x000000016dae5c00 lr: 0x00000001026cf6e0
sp: 0x000000016dae5bc0 pc: 0x00000001026c7440 cpsr: 0x00000000
esr: 0x00000000 Address size fault
Binary images description not available
Error Formulating Crash Report:
Failed to create CSSymbolicatorRef - corpse still valid ¯\_(ツ)_/¯
EOF
Several users reported this bug. I cannot reproduce this bug using iOS 14.2.x. But users with iOS 14.4 and 14.8.1 are seeing this bug constantly.
(FB9967946)
Anyone can find the full screen button?
I cannot make it full screen:
https://imgur.com/Lhcq5Ji