Open jinios opened 6 years ago
func stackUp(newCard: Card?, newCards: [Card]?, column: Int) {
guard let card = newCard else {return}
foundations[column].push(newCard: card)
}
func cardIndexInStack(originY: CGFloat) -> Int {
return Int(originY / 15.0)
}
Question:
Answer:
@objc func dragAction(notification: Notification) {
...
switch recognizer.state {
case .began:
// do something
case .changed:
// do something
case .ended:
// do something
case .cancelled: return
default: return
}
}
func cardImages(at: Int?) -> [CardImageView]? {
var result = [CardImageView]()
guard self.subviews.count == self.stackManager.countOfCard() else { return result }
guard let index = at else { return result }
guard index != self.subviews.count else { return [lastCardView!] }
for i in index..<self.stackManager.countOfCard() {
result.append(self.subviews[i] as! CardImageView)
}
return result
}
Step5 피드백 내용 정리