Files
divkit/client/ios/LayoutKitPlayground/Image.playground/Contents.swift
T
pkurchatov 32ca53c33d Applied swiftformat
commit_hash:9c5ecfc2fd0b9a8622daa639e908bceb6891d85c
2024-11-25 23:23:00 +03:00

23 lines
561 B
Swift

import LayoutKit
import LayoutKitPlayground
import PlaygroundSupport
import UIKit
import VGSL
private func createBlock() throws -> Block {
try ContainerBlock(
layoutDirection: .vertical,
horizontalChildrenAlignment: .center,
verticalChildrenAlignment: .center,
children: [
ImageBlock(
imageHolder: UIImage(named: "ferrari_F40_front.jpg")!,
widthTrait: .fixed(300.0),
heightTrait: .fixed(200.0)
),
]
)
}
PlaygroundPage.current.liveView = LayoutKitPlaygroundViewController(blockProvider: createBlock)