From 982f3f31bdace91dfae52a066c856f232fb99f81 Mon Sep 17 00:00:00 2001 From: LukasM01 Date: Thu, 20 Jun 2019 18:58:49 +0200 Subject: [PATCH] Added @available --- .../SwiftUIFormattedText.swift | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Sources/SwiftUIFormattedText/SwiftUIFormattedText.swift b/Sources/SwiftUIFormattedText/SwiftUIFormattedText.swift index eee2f92..ef4357c 100644 --- a/Sources/SwiftUIFormattedText/SwiftUIFormattedText.swift +++ b/Sources/SwiftUIFormattedText/SwiftUIFormattedText.swift @@ -7,6 +7,9 @@ // import SwiftUI + +@available(OSX 10.15, *) +@available(iOS 13.0, *) struct AttributedStringStyle { let font: Font? let weight: Font.Weight? @@ -44,9 +47,13 @@ struct AttributedStringStyle { return AttributedStringStyle(font: font, weight: weight, color: color, italic: italic, underline: underline, block: block) } } +@available(OSX 10.15, *) +@available(iOS 13.0, *) extension AttributedStringStyle: Equatable { } +@available(OSX 10.15, *) +@available(iOS 13.0, *) indirect enum Tag { case array([Tag]) case font(style: AttributedStringStyle, child: Tag) @@ -91,6 +98,8 @@ indirect enum Tag { } } } +@available(OSX 10.15, *) +@available(iOS 13.0, *) extension Tag: Equatable { static func == (lhs: Tag, rhs: Tag) -> Bool { switch (lhs, rhs) { @@ -107,6 +116,8 @@ extension Tag: Equatable { } } } +@available(OSX 10.15, *) +@available(iOS 13.0, *) extension Tag { static func parse(from string: String) -> Tag { let entityMap: [String: String] = [ @@ -375,7 +386,8 @@ extension Tag { return result } } - +@available(OSX 10.15, *) +@available(iOS 13.0, *) struct FormattedText : View { var formatted: String var renderedTag: some View {