diff --git a/app-ios/Modules/Sources/Session/SessionView.swift b/app-ios/Modules/Sources/Session/SessionView.swift index f5263bee1..b63f9513e 100644 --- a/app-ios/Modules/Sources/Session/SessionView.swift +++ b/app-ios/Modules/Sources/Session/SessionView.swift @@ -15,7 +15,8 @@ private let startDateFormatter: DateFormatter = { public struct SessionView: View { let viewModel: SessionViewModel @State private var isDescriptionExpanded: Bool = false - @State private var canBeExpanded = false + @State private var canBeExpanded: Bool = false + @State private var presentingURL: IdentifiableURL? public init(timetableItem: TimetableItem) { self.viewModel = .init(timetableItem: timetableItem) @@ -65,7 +66,7 @@ public struct SessionView: View { if let session = viewModel.timetableItem as? TimetableItem.Session { VStack(alignment: .leading, spacing: 16) { - Text(session.description_.currentLangTitle) + Text(.init(session.description_.currentLangTitle)) .textSelection(.enabled) .lineLimit(isDescriptionExpanded ? nil : 5) .background { @@ -189,7 +190,16 @@ public struct SessionView: View { } } } - + .sheet(item: $presentingURL) { url in + if let url = url.id { + SafariView(url: url) + .ignoresSafeArea() + } + } + .environment(\.openURL, OpenURLAction { url in + presentingURL = IdentifiableURL(url) + return .handled + }) } }