Disable unnecessary UIAppearance hacks on iOS 16

This commit is contained in:
Shadowfacts 2022-06-07 09:42:33 -04:00
parent 01bb37b0f6
commit f5ac2616ad
2 changed files with 13 additions and 5 deletions

View File

@ -110,10 +110,14 @@ struct ComposeAttachmentsList: View {
} }
private func didAppear() { private func didAppear() {
let proxy = UITableView.appearance(whenContainedInInstancesOf: [ComposeHostingController.self]) if #available(iOS 16.0, *) {
// enable drag and drop to reorder on iPhone // these appearance proxy hacks are no longer necessary
proxy.dragInteractionEnabled = true } else {
proxy.isScrollEnabled = false let proxy = UITableView.appearance(whenContainedInInstancesOf: [ComposeHostingController.self])
// enable drag and drop to reorder on iPhone
proxy.dragInteractionEnabled = true
proxy.isScrollEnabled = false
}
} }
private func attachmentsChanged(attachments: [CompositionAttachment]) { private func attachmentsChanged(attachments: [CompositionAttachment]) {

View File

@ -46,7 +46,11 @@ struct OppositeCollapseKeywordsView: View {
} }
private func updateAppearance() { private func updateAppearance() {
UIScrollView.appearance(whenContainedInInstancesOf: [PreferencesNavigationController.self]).keyboardDismissMode = .interactive if #available(iOS 16.0, *) {
// no longer necessary
} else {
UIScrollView.appearance(whenContainedInInstancesOf: [PreferencesNavigationController.self]).keyboardDismissMode = .interactive
}
} }
private func commitExisting(at index: Int) -> () -> Void { private func commitExisting(at index: Int) -> () -> Void {