Skip to content

Commit

Permalink
feat: PressButtonStyleの追加
Browse files Browse the repository at this point in the history
  • Loading branch information
tsuzukihashi committed Apr 28, 2023
1 parent eb7b8c3 commit 4d40f89
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# TsuzuKit
# TsuzuKit
オレオレSwiftUIライブラリ
15 changes: 15 additions & 0 deletions Sources/TsuzuKit/PressButtonStyle.swift
Original file line number Diff line number Diff line change
@@ -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()
}
}
6 changes: 0 additions & 6 deletions Sources/TsuzuKit/TsuzuKit.swift

This file was deleted.

0 comments on commit 4d40f89

Please sign in to comment.