Tune availability scope
This commit is contained in:
parent
e3f915b2cb
commit
c0fe6d494c
|
@ -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]
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue