From 0c38214d3ce5b24352e0fcea53765118d66a76d9 Mon Sep 17 00:00:00 2001 From: leoz Date: Wed, 24 Jan 2024 18:36:52 -0500 Subject: Add demo app --- Demo/SwiftyCropDemo/ShapeButton.swift | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Demo/SwiftyCropDemo/ShapeButton.swift (limited to 'Demo/SwiftyCropDemo/ShapeButton.swift') diff --git a/Demo/SwiftyCropDemo/ShapeButton.swift b/Demo/SwiftyCropDemo/ShapeButton.swift new file mode 100644 index 0000000..c7aae9f --- /dev/null +++ b/Demo/SwiftyCropDemo/ShapeButton.swift @@ -0,0 +1,32 @@ +// +// ShapeButton.swift +// SwiftyCropDemo +// +// Created by Leonid Zolotarev on 1/24/24. +// + +import SwiftUI +import SwiftyCrop + +struct ShapeButton: View { + let title: String + let shape: MaskShape + @Binding var selection: MaskShape + + var body: some View { + Button { + selection = shape + } label: { + LongText(title: title) + } + .foregroundColor(selection == shape ? .accentColor : .secondary) + } +} + +#Preview { + ShapeButton( + title: "title", + shape: .circle, + selection: .constant(.circle) + ) +} -- cgit v1.2.3