Post

Replies

Boosts

Views

Activity

Reply to How to sum the same category total in SwiftUI?
Thank you sir, i tried it again but i got this error like below: let newArray = expensesData.filter {format(date: $0.date) == format(date: self.currentDate)}         let expenseArray = newArray.filter {$0.type == "Expense"}          //        self.sortedByExpense = expenseArray.sorted(by: {$0.amount > $1.amount})                  var icons: [String] = []         for i in expenseArray {             icons.append(i.expenseIcon)         }         print(icons)         var sums: [String] = []         for i in icons {             sums[i] = expenseArray.filter{$0.expenseIcon == i}.reduce(0){sum, item in sum + item.amount} //No 'reduce' candidates produce the expected contextual result type 'String' //No exact matches in call to subscript          }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’22
Reply to How to make sound effects in spinning wheel?
Hey @Claude31 I have no idea how to get typical spinning parameters :( .onTapGesture { withAnimation(Animation.timingCurve(0.0, 0.8, 0.2, 1.0, duration: 10)) {                  self.chanceVM.rotateDegree = Double.random(in: 5400.0...7200.0)                } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’22