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 {
/// Configuration which will be used for preview generation
@available(iOS 13, *)
public struct PreviewConfiguration {
let themes: [Theme]
let contentSize: [UIContentSizeCategory]

View File

@ -5,15 +5,16 @@ import UIKit
extension UICatalog {
/// Describes the preview that will be generated
@available(iOS 14, *)
public struct PreviewDescriptor: Identifiable, Hashable {
let builder: () -> AnyView
/// Unique identifier
public let id: String // swiftlint:disable:this identifier_name
/// Preview title
public let title: String
/// 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) {
hasher.combine(id)