From 4d40f898916fb1c1e84b280359b78adb6f49651f Mon Sep 17 00:00:00 2001 From: tsuzukihashi Date: Sat, 29 Apr 2023 00:51:11 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20PressButtonStyle=E3=81=AE=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Package.swift | 1 + README.md | 3 ++- Sources/TsuzuKit/PressButtonStyle.swift | 15 +++++++++++++++ Sources/TsuzuKit/TsuzuKit.swift | 6 ------ 4 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 Sources/TsuzuKit/PressButtonStyle.swift delete mode 100644 Sources/TsuzuKit/TsuzuKit.swift diff --git a/Package.swift b/Package.swift index 8f01011..8a89df3 100644 --- a/Package.swift +++ b/Package.swift @@ -5,6 +5,7 @@ import PackageDescription let package = Package( name: "TsuzuKit", + platforms: [.iOS(.v16)], products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. .library( diff --git a/README.md b/README.md index b9ebb05..3f25410 100644 --- a/README.md +++ b/README.md @@ -1 +1,2 @@ -# TsuzuKit \ No newline at end of file +# TsuzuKit +オレオレSwiftUIライブラリ diff --git a/Sources/TsuzuKit/PressButtonStyle.swift b/Sources/TsuzuKit/PressButtonStyle.swift new file mode 100644 index 0000000..5c7dcf5 --- /dev/null +++ b/Sources/TsuzuKit/PressButtonStyle.swift @@ -0,0 +1,15 @@ +import SwiftUI + +struct PressButtonStyle: ButtonStyle { + func makeBody(configuration: Configuration) -> some View { + return configuration.label + .scaleEffect(configuration.isPressed ? 1.1 : 1) + .animation(.spring(response: 0.2, dampingFraction: 0.9), value: configuration.isPressed) + } +} + +extension ButtonStyle where Self == PressButtonStyle { + static var squemo: Self { + return .init() + } +} diff --git a/Sources/TsuzuKit/TsuzuKit.swift b/Sources/TsuzuKit/TsuzuKit.swift deleted file mode 100644 index c5fa8c7..0000000 --- a/Sources/TsuzuKit/TsuzuKit.swift +++ /dev/null @@ -1,6 +0,0 @@ -public struct TsuzuKit { - public private(set) var text = "Hello, World!" - - public init() { - } -}