From cf190cfd802aa152d7752b6500b483bd897b237a Mon Sep 17 00:00:00 2001 From: Fumito Ito Date: Fri, 23 Aug 2024 17:13:15 +0900 Subject: [PATCH] add annotation for tvOS --- Sources/Template.swift | 2 +- Sources/TemplateRepository.swift | 6 +++--- .../TemplateFromMethodsTests/TemplateFromMethodsTests.swift | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/Template.swift b/Sources/Template.swift index e67d1b5..487dc4c 100644 --- a/Sources/Template.swift +++ b/Sources/Template.swift @@ -95,7 +95,7 @@ final public class Template { /// - parameter encoding: The encoding of the template resource. /// - parameter configuration: The configuration for rendering. If the configuration is not specified, `Configuration.default` is used. /// - throws: MustacheError - @available(iOS 15.0, macOS 12.0, *) + @available(iOS 15.0, macOS 12.0, tvOS 15.0, *) public convenience init(URL: Foundation.URL, encoding: String.Encoding = .utf8, configuration: Configuration = .default) async throws { let baseURL = URL.deletingLastPathComponent() let templateExtension = URL.pathExtension diff --git a/Sources/TemplateRepository.swift b/Sources/TemplateRepository.swift index fb25701..fc1154b 100644 --- a/Sources/TemplateRepository.swift +++ b/Sources/TemplateRepository.swift @@ -82,7 +82,7 @@ public protocol TemplateRepositoryDataSource { /// - parameter templateID: The template ID of the template. /// - throws: MustacheError /// - returns: A Mustache template string. - @available(iOS 15.0, macOS 12.0, *) + @available(iOS 15.0, macOS 12.0, tvOS 15.0, *) func templateStringForTemplateID(_ templaetID: TemplateID) async throws -> String } @@ -353,7 +353,7 @@ final public class TemplateRepository { } } - @available(iOS 15.0, macOS 12.0, *) + @available(iOS 15.0, macOS 12.0, tvOS 15.0, *) func templateAST(named name: String, relativeToTemplateID baseTemplateID: TemplateID? = nil) async throws -> TemplateAST { guard let dataSource = self.dataSource else { throw MustacheError(kind: .templateNotFound, message: "Missing dataSource", templateID: baseTemplateID) @@ -510,7 +510,7 @@ final public class TemplateRepository { return try NSString(contentsOf: URL(string: templateID)!, encoding: encoding.rawValue) as String } - @available(iOS 15.0, macOS 12.0, *) + @available(iOS 15.0, macOS 12.0, tvOS 15.0, *) func templateStringForTemplateID(_ templateID: TemplateID) async throws -> String { let (data, _) = try await URLSession.shared.data(from: URL(string: templateID)!) diff --git a/Tests/Public/TemplateTests/TemplateFromMethodsTests/TemplateFromMethodsTests.swift b/Tests/Public/TemplateTests/TemplateFromMethodsTests/TemplateFromMethodsTests.swift index ad934a8..3bb7fd3 100644 --- a/Tests/Public/TemplateTests/TemplateFromMethodsTests/TemplateFromMethodsTests.swift +++ b/Tests/Public/TemplateTests/TemplateFromMethodsTests/TemplateFromMethodsTests.swift @@ -275,7 +275,7 @@ class TemplateFromMethodsTests: XCTestCase { } } -@available(iOS 15.0, macOS 12.0, *) +@available(iOS 15.0, macOS 12.0, tvOS 15.0, *) extension TemplateFromMethodsTests { func testTemplateFromURL() async { let template = try! await Template(URL: templateURL)