Skip to content

Commit

Permalink
Improve logic
Browse files Browse the repository at this point in the history
  • Loading branch information
omarthamri committed Dec 1, 2023
1 parent 2d87513 commit e03ff10
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Example/Tests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.8</string>
<string>1.9</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion MyTinderSwipingAnimation.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'MyTinderSwipingAnimation'
s.version = '1.8'
s.version = '1.9'
s.summary = 'TinderSwipingAnimation is an easy to use library written using SwiftUI to simplify the implementation of the tinder swipe animation.'

# This description is used to generate tags and improve search results.
Expand Down
9 changes: 6 additions & 3 deletions Sources/TinderSwipingAnimation/Views/CardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import SwiftUI
import Combine

struct CardView: View {
@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 x: [CGFloat]
@State var y: [CGFloat]
@State var degree: [Double]
@State var offset: CGFloat = 0.0
var cards: [CardModel]
var buttons: [ButtonModel]
Expand All @@ -22,6 +22,9 @@ struct CardView: View {
var onSwipe : (_ card: CardModel,_ direction: Direction) -> () = { (card,direction) in }
public init(cards: [CardModel], buttons: [ButtonModel],viewModel: TinderViewModel,orientation: TextOrientation,backgroundColor: Color) {
self.cards = cards
self._x = State(initialValue: Array(repeating: 0, count: cards.count))
self._y = State(initialValue: Array(repeating: 0, count: cards.count))
self._degree = State(initialValue: Array(repeating: 0, count: cards.count))
self.buttons = buttons
self.orientation = orientation
self.backgroundColor = backgroundColor
Expand Down

0 comments on commit e03ff10

Please sign in to comment.