From fb3c542264720002b1cc5e29061e46891dd3b767 Mon Sep 17 00:00:00 2001 From: Callum Yarnold Date: Wed, 25 May 2022 19:59:06 +0100 Subject: [PATCH] Fix text on iOS 14 where markdown isn't available --- ntfy/Views/NotificationListView.swift | 10 ++++++++-- ntfy/Views/SubscriptionListView.swift | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ntfy/Views/NotificationListView.swift b/ntfy/Views/NotificationListView.swift index 919f40d..f205b61 100644 --- a/ntfy/Views/NotificationListView.swift +++ b/ntfy/Views/NotificationListView.swift @@ -144,8 +144,14 @@ struct NotificationListView: View { .foregroundColor(.gray) .multilineTextAlignment(.center) .padding(.bottom) - Text("To send notifications to this topic, simply PUT or POST to the topic URL.\n\nExample:\n`$ curl -d \"hi\" ntfy.sh/\(subscription.topicName())`\n\nDetailed instructions are available on [ntfy.sh](https;//ntfy.sh) and [in the docs](https:ntfy.sh/docs).") - .foregroundColor(.gray) + + if #available(iOS 15.0, *) { + Text("To send notifications to this topic, simply PUT or POST to the topic URL.\n\nExample:\n`$ curl -d \"hi\" ntfy.sh/\(subscription.topicName())`\n\nDetailed instructions are available on [ntfy.sh](https://ntfy.sh) and [in the docs](https://ntfy.sh/docs).") + .foregroundColor(.gray) + } else { + Text("To send notifications to this topic, simply PUT or POST to the topic URL.\n\nExample:\n`$ curl -d \"hi\" ntfy.sh/\(subscription.topicName())`\n\nDetailed instructions are available on https://ntfy.sh and https://ntfy.sh/docs.") + .foregroundColor(.gray) + } } .padding(40) } diff --git a/ntfy/Views/SubscriptionListView.swift b/ntfy/Views/SubscriptionListView.swift index 7e99015..c0f32d9 100644 --- a/ntfy/Views/SubscriptionListView.swift +++ b/ntfy/Views/SubscriptionListView.swift @@ -66,8 +66,14 @@ struct SubscriptionListView: View { .foregroundColor(.gray) .multilineTextAlignment(.center) .padding(.bottom) - Text("Click the + to create or subscribe to a topic. Afterwards, you receive notifications on your device when sending messages via PUT or POST.\n\nDetailed instructions are available on [ntfy.sh](https;//ntfy.sh) and [in the docs](https:ntfy.sh/docs).") - .foregroundColor(.gray) + + if #available(iOS 15.0, *) { + Text("Click the + to create or subscribe to a topic. Afterwards, you receive notifications on your device when sending messages via PUT or POST.\n\nDetailed instructions are available on [ntfy.sh](https://ntfy.sh) and [in the docs](https://ntfy.sh/docs).") + .foregroundColor(.gray) + } else { + Text("Click the + to create or subscribe to a topic. Afterwards, you receive notifications on your device when sending messages via PUT or POST.\n\nDetailed instructions are available on https://ntfy.sh and https://ntfy.sh/docs") + .foregroundColor(.gray) + } } .padding(40) }