Revert "Drop iOS 14 and macOS 11 support"

This reverts commit dcef7f47ff.
This commit is contained in:
Arkadiusz Fal
2023-10-15 13:35:23 +02:00
parent 053b4a22b8
commit 94915b0496
45 changed files with 695 additions and 88 deletions

View File

@@ -219,17 +219,25 @@ struct CommentView: View {
}
private var commentText: some View {
Text(comment.text)
#if !os(tvOS)
.textSelection(.enabled)
#endif
#if os(macOS)
.font(.system(size: 14))
#elseif os(iOS)
.font(.system(size: 15))
#endif
.lineSpacing(3)
.fixedSize(horizontal: false, vertical: true)
Group {
let text = Text(comment.text)
#if os(macOS)
.font(.system(size: 14))
#elseif os(iOS)
.font(.system(size: 15))
#endif
.lineSpacing(3)
.fixedSize(horizontal: false, vertical: true)
if #available(iOS 15.0, macOS 12.0, *) {
text
#if !os(tvOS)
.textSelection(.enabled)
#endif
} else {
text
}
}
}
private func openChannelAction() {

View File

@@ -32,8 +32,13 @@ struct CommentsView: View {
struct CommentsView_Previews: PreviewProvider {
static var previews: some View {
if #available(iOS 15.0, macOS 12.0, tvOS 15.0, *) {
CommentsView()
.previewInterfaceOrientation(.landscapeRight)
.injectFixtureEnvironmentObjects()
}
CommentsView()
.previewInterfaceOrientation(.landscapeRight)
.injectFixtureEnvironmentObjects()
}
}

View File

@@ -79,10 +79,15 @@ struct InspectorView: View {
Text(detail.localized())
.foregroundColor(.secondary)
Spacer()
Text(value).lineLimit(1)
#if !os(tvOS)
let value = Text(value).lineLimit(1)
if #available(iOS 15.0, macOS 12.0, *) {
value
#if !os(tvOS)
.textSelection(.enabled)
#endif
#endif
} else {
value
}
}
.font(.caption)
}

View File

@@ -30,9 +30,8 @@ struct PlayerQueueView: View {
#endif
Color.clear.padding(.bottom, 50)
.listRowBackground(Color.clear)
#if os(iOS)
.listRowSeparator(.hidden)
#endif
.backport
.listRowSeparator(false)
}
.environment(\.inNavigationView, false)
}

View File

@@ -59,15 +59,23 @@ struct VideoDescription: View {
@ViewBuilder var textDescription: some View {
#if !os(iOS)
Text(description)
.frame(maxWidth: .infinity, alignment: .leading)
.lineLimit(shouldExpand ? 500 : Self.collapsedLines)
#if !os(tvOS)
.textSelection(.enabled)
#endif
.multilineTextAlignment(.leading)
.font(.system(size: 14))
.lineSpacing(3)
Group {
if #available(macOS 12, *) {
Text(description)
.frame(maxWidth: .infinity, alignment: .leading)
.lineLimit(shouldExpand ? 500 : Self.collapsedLines)
#if !os(tvOS)
.textSelection(.enabled)
#endif
} else {
Text(description)
.frame(maxWidth: .infinity, alignment: .leading)
.lineLimit(shouldExpand ? 500 : Self.collapsedLines)
}
}
.multilineTextAlignment(.leading)
.font(.system(size: 14))
.lineSpacing(3)
#endif
}