Skip to content

Commit

Permalink
Added @available
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmoellerch committed Jun 20, 2019
1 parent e565e6e commit 982f3f3
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Sources/SwiftUIFormattedText/SwiftUIFormattedText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
//

import SwiftUI

@available(OSX 10.15, *)
@available(iOS 13.0, *)
struct AttributedStringStyle {
let font: Font?
let weight: Font.Weight?
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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) {
Expand All @@ -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] = [
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 982f3f3

Please sign in to comment.