diff --git a/Example/Pods/Target Support Files/Pods-MyTinderSwipingAnimation_Tests/Pods-MyTinderSwipingAnimation_Tests-Info.plist b/Example/Pods/Target Support Files/Pods-MyTinderSwipingAnimation_Tests/Pods-MyTinderSwipingAnimation_Tests-Info.plist index 8b35aeb..4bef146 100644 --- a/Example/Pods/Target Support Files/Pods-MyTinderSwipingAnimation_Tests/Pods-MyTinderSwipingAnimation_Tests-Info.plist +++ b/Example/Pods/Target Support Files/Pods-MyTinderSwipingAnimation_Tests/Pods-MyTinderSwipingAnimation_Tests-Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.6 + 1.7 CFBundleSignature ???? CFBundleVersion diff --git a/Example/Tests/Info.plist b/Example/Tests/Info.plist index ef5edb6..540c3ea 100644 --- a/Example/Tests/Info.plist +++ b/Example/Tests/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.6 + 1.7 CFBundleSignature ???? CFBundleVersion diff --git a/MyTinderSwipingAnimation.podspec b/MyTinderSwipingAnimation.podspec index 8fb793c..acb05b1 100644 --- a/MyTinderSwipingAnimation.podspec +++ b/MyTinderSwipingAnimation.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'MyTinderSwipingAnimation' - s.version = '1.6' + s.version = '1.7' s.summary = 'TinderSwipingAnimation is a library written using SwiftUI to simplify the implementation of the tinder swipe animation.' # This description is used to generate tags and improve search results. diff --git a/Sources/TinderSwipingAnimation/Components/CustomButton.swift b/Sources/TinderSwipingAnimation/Components/CustomButton.swift index d22562b..ae68016 100644 --- a/Sources/TinderSwipingAnimation/Components/CustomButton.swift +++ b/Sources/TinderSwipingAnimation/Components/CustomButton.swift @@ -21,9 +21,9 @@ struct CustomButton: View { case .goLeft: viewModel.goLeft = true case .goTop: - break + viewModel.goTop = true case .goBottom: - break + viewModel.goBottom = true } }) { button.image diff --git a/Sources/TinderSwipingAnimation/Models/Direction.swift b/Sources/TinderSwipingAnimation/Models/Direction.swift index 199ac22..eb26e66 100644 --- a/Sources/TinderSwipingAnimation/Models/Direction.swift +++ b/Sources/TinderSwipingAnimation/Models/Direction.swift @@ -11,10 +11,14 @@ public enum Direction { case right case left + case top + case bottom public var description: String { switch self { case .right: return "right" case .left: return "left" + case .top: return "top" + case .bottom: return "bottom" } } } diff --git a/Sources/TinderSwipingAnimation/ViewModels/TinderViewModel.swift b/Sources/TinderSwipingAnimation/ViewModels/TinderViewModel.swift index 2061eca..adc2bd2 100644 --- a/Sources/TinderSwipingAnimation/ViewModels/TinderViewModel.swift +++ b/Sources/TinderSwipingAnimation/ViewModels/TinderViewModel.swift @@ -17,4 +17,6 @@ class TinderViewModel: ObservableObject { @Published var cards: [CardModel] = [] @Published var goRight: Bool = false @Published var goLeft: Bool = false + @Published var goTop: Bool = false + @Published var goBottom: Bool = false } diff --git a/Sources/TinderSwipingAnimation/Views/CardView.swift b/Sources/TinderSwipingAnimation/Views/CardView.swift index b28dd74..ad52e9d 100644 --- a/Sources/TinderSwipingAnimation/Views/CardView.swift +++ b/Sources/TinderSwipingAnimation/Views/CardView.swift @@ -9,8 +9,9 @@ import SwiftUI import Combine struct CardView: View { - @State var x: [CGFloat] = [0,0,0,0,0,0,0] - @State var degree: [Double] = [0,0,0,0,0,0,0] + @State var x: [CGFloat] = [0,0,0,0,0,0,0,0,0,0,0,0,0,0] + @State var y: [CGFloat] = [0,0,0,0,0,0,0,0,0,0,0,0,0,0] + @State var degree: [Double] = [0,0,0,0,0,0,0,0,0,0,0,0,0,0] @State var offset: CGFloat = 0.0 var cards: [CardModel] var buttons: [ButtonModel] @@ -26,7 +27,13 @@ struct CardView: View { viewModel.$goRight.sink { _ in } .store(in: &subscriptions) - viewModel.$goLeft.sink { _ in + viewModel.$goLeft.sink { _ in + } + .store(in: &subscriptions) + viewModel.$goTop.sink { _ in + } + .store(in: &subscriptions) + viewModel.$goBottom.sink { _ in } .store(in: &subscriptions) } @@ -34,10 +41,10 @@ struct CardView: View { ZStack { ForEach(0..