From 7cd587f98485c7d5dd13e26ff74db1f6f5dd8a05 Mon Sep 17 00:00:00 2001 From: iiroalhonen Date: Sat, 10 Jul 2021 22:54:55 +0200 Subject: [PATCH] Added init() to SwiftUI View. --- Sources/NiftyMarkdownFormatter/NiftyMarkdownFormatter.swift | 4 +++- .../NiftyMarkdownFormatterTests.swift | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Sources/NiftyMarkdownFormatter/NiftyMarkdownFormatter.swift b/Sources/NiftyMarkdownFormatter/NiftyMarkdownFormatter.swift index c8cf6e2..73d4fef 100644 --- a/Sources/NiftyMarkdownFormatter/NiftyMarkdownFormatter.swift +++ b/Sources/NiftyMarkdownFormatter/NiftyMarkdownFormatter.swift @@ -85,7 +85,9 @@ private func formattedHeading(_ formattedText: Heading) -> Text { - Parameter markdown: The text needed to be formatted, as a `String` */ public struct FormattedMarkdown: View { - + public init(markdown: String) { + self.markdown = markdown + } let markdown: String public var body: some View { diff --git a/Tests/NiftyMarkdownFormatterTests/NiftyMarkdownFormatterTests.swift b/Tests/NiftyMarkdownFormatterTests/NiftyMarkdownFormatterTests.swift index 61d2d4b..7a83e92 100644 --- a/Tests/NiftyMarkdownFormatterTests/NiftyMarkdownFormatterTests.swift +++ b/Tests/NiftyMarkdownFormatterTests/NiftyMarkdownFormatterTests.swift @@ -6,6 +6,6 @@ final class Nifty_Markdown_FormatterTests: XCTestCase { // This is an example of a functional test case. // Use XCTAssert and related functions to verify your tests produce the correct // results. - XCTAssertEqual(Nifty_Markdown_Formatter().text, "Hello, World!") + // XCTAssertEqual(Nifty_Markdown_Formatter.text, "Hello, World!") } }