Tune availability scope

This commit is contained in:
Alexandr Goncharov 2020-10-27 10:13:18 +03:00
parent e3f915b2cb
commit c0fe6d494c
2 changed files with 4 additions and 2 deletions

View File

@ -5,6 +5,7 @@ import UIKit
extension UICatalog { extension UICatalog {
/// Configuration which will be used for preview generation /// Configuration which will be used for preview generation
@available(iOS 13, *)
public struct PreviewConfiguration { public struct PreviewConfiguration {
let themes: [Theme] let themes: [Theme]
let contentSize: [UIContentSizeCategory] let contentSize: [UIContentSizeCategory]

View File

@ -5,15 +5,16 @@ import UIKit
extension UICatalog { extension UICatalog {
/// Describes the preview that will be generated /// Describes the preview that will be generated
@available(iOS 14, *)
public struct PreviewDescriptor: Identifiable, Hashable { public struct PreviewDescriptor: Identifiable, Hashable {
let builder: () -> AnyView let builder: () -> AnyView
/// Unique identifier /// Unique identifier
public let id: String // swiftlint:disable:this identifier_name public let id: String // swiftlint:disable:this identifier_name
/// Preview title /// Preview title
public let title: String public let title: String
/// Returns generated preview /// Returns generated preview
public var preview: Preview { Preview(builder(), title: title) } @available(iOS 14, *)
public func preview() -> Preview { Preview(builder(), title: title) }
public func hash(into hasher: inout Hasher) { public func hash(into hasher: inout Hasher) {
hasher.combine(id) hasher.combine(id)