Here's my take on the ZStack method:
ZStack(alignment: .topLeading) {
TextEditor(text: $draftPreface)
.frame(height: 100)
.border(Color(uiColor: .opaqueSeparator), width: 0.5)
Text("preface").fontWeight(.light).foregroundColor(.black.opacity(0.25)).padding(8).hidden(!draftPreface.isEmpty)
}
I extended View with a conditional .hidden:
extension View {
@ViewBuilder public func hidden(_ shouldHide: Bool) -> some View {
switch shouldHide {
case true: self.hidden()
case false: self
}
}
}
Post
Replies
Boosts
Views
Activity
I understand now. The Done button is useful for cancelling the swipe.
swipe to reveal the hidden button(s) behind the row.
decide you don't want to use those buttons.
A) swipe the row back
B) OR interact somewhere else
C) OR tap Done to have the row return to normal.
The EditMode isActive is true while the row is swiped aside, but the value is not .active.
Notes has a Recently Deleted folder view that shows a search field and some captions above the list. The whole vertical stack is scrollable. That makes me think they're using UIKit and not SwiftUI.
Video
Using ForEach with a Divider won't allow .swipeActions to work, as it must be inside a List.
I think you'll be happy with .textSelection(.enabled) in the next release of SwiftUI.
Error found in programmer brain. I was sending the wrong token.
Answering my own question: Yes. when the issue occurs, go to the issues navigator, control-click any of the main-thread issues, and choose Create Breakpoint from the context menu. All main-thread issue will now break. (Xcode 9 used to have a "Pause on issues" checkbox but that is gone in Xcode 12.)
I discussed this with developer support using up one of my 2 annual tickets. For people like me with individual developer accounts you cannot add other accounts to the team, at least not without ponying up for a second $99/year account.
Instead the best option was to use a separate container for release. Just have to be sure to rebuild and test with the correct container before releasing the app :-)
Is there a breakpoint I can set to intercept the moment the non-main post occurs? I believe I've properly addressed the cases where it could occur but it's still happening anyway.
Xcode 12.5 has this too. I've noticed it only happens with one workspace. I've tried it two iOS devices. The other workspaces are fine. Interestingly this sometimes works, sometimes not. Neither cleaning nor deleting DerivedData files has any effect.
Getting this isn't a problem for me so much as the error message not pointing to ways to resolve it.
Right after posting this I thought of a crude way to do it: dive into the app's sandbox on a simulator...
/Users/«USER»/Library/Developer/CoreSimulator/Devices/«DEVICE»/data/Containers/Data/Application/«APP»/Library/SyncedPreferences/«BUNDLE».plist
Good enough for debugging, but having a keys property would be better. I mean, if I need to clean up disused prefs I had really better never forget which keys were used when I shipped.
Aw heck, I'll just do this bit in UIKit. It supports rearranging rows across sections.
Fascinating, and thank you. The code completion feature offers two variants of awakeFromNib (class and instance) and does not distinguish them. I'll double-check both of these flaws in the latest Xcode and will report them if they're unfixed.
It never occurred to me to notice the class keyword, although I did notice the error using the adjective "instance".
Oh Apple.
That seems most likely at this point. I've sent a bug report with this code.
I never doubted it was impossible. Using a proxy is much less ugly an alternative so I'll go with that.