From f5075f4da8c1d79ad64f4760fc53f1e2061f7f6c Mon Sep 17 00:00:00 2001 From: Matte23 Date: Mon, 7 Dec 2020 00:29:10 +0100 Subject: [PATCH] Fix some url broken on iOS --- ios/circolapp/circolapp/View/AttachmentView.swift | 2 +- ios/circolapp/circolapp/View/CircularView.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/circolapp/circolapp/View/AttachmentView.swift b/ios/circolapp/circolapp/View/AttachmentView.swift index ace95d1..19ed95f 100644 --- a/ios/circolapp/circolapp/View/AttachmentView.swift +++ b/ios/circolapp/circolapp/View/AttachmentView.swift @@ -33,7 +33,7 @@ struct AttachmentView: View { Spacer() Button(action: { - guard let url = URL(string: attachmentUrl) else { return } + guard let url = URL(string: attachmentUrl.addingPercentEncoding(withAllowedCharacters: .urlFragmentAllowed)!) else { return } UIApplication.shared.open(url) }) { Image(systemName: "envelope.open") diff --git a/ios/circolapp/circolapp/View/CircularView.swift b/ios/circolapp/circolapp/View/CircularView.swift index c0e24dd..e8d0842 100644 --- a/ios/circolapp/circolapp/View/CircularView.swift +++ b/ios/circolapp/circolapp/View/CircularView.swift @@ -50,7 +50,7 @@ struct CircularView: View { if showDetail { HStack { Button(action: { - guard let url = URL(string: circular.url) else { return } + guard let url = URL(string: circular.url.addingPercentEncoding(withAllowedCharacters: .urlFragmentAllowed)!) else { return } UIApplication.shared.open(url) }) { Image(systemName: "envelope.open")