Skip to content

Commit

Permalink
Merge pull request #13 from mleonhard/main
Browse files Browse the repository at this point in the history
Add iOS 15 constraint to image handling code
  • Loading branch information
Iikeli authored May 2, 2022
2 parents 80fc592 + c3a2fa4 commit 5ca3491
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/NiftyMarkdownFormatter/Images.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ internal func formatImageComponents(_ string: String) -> (String, URL?) {

- Returns: a `some View` containing an `AsyncImage` view.
*/
@available(macOS 12.0, *)
@available(iOS 15, macOS 12, *)
internal func formatImage(altText: String?, url: URL?) -> some View {
let image = AsyncImage(url: url) { image in
image.accessibilityLabel(altText ?? "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public func formattedMarkdownArray(markdown: String) -> [AnyView] {
} else if string.count == 0 {
// Ignore empty lines
} else if string.starts(with: "![") {
if #available(macOS 12.0, *) {
if #available(iOS 15, macOS 12, *) {
let imageComponents = formatImageComponents(string)
formattedViews.append(AnyView(formatImage(altText: imageComponents.0, url: imageComponents.1)))
} else {
Expand Down

0 comments on commit 5ca3491

Please sign in to comment.